Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Free scrolling after jumping to the PDF annotation link #259

Merged
merged 1 commit into from
Nov 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Free scrolling when jumping to the PDF annotation link
  • Loading branch information
HardwayLinka committed Nov 14, 2022
commit d82b08bbd132b0ddc632808f016f24c16585ee35
2 changes: 1 addition & 1 deletion src/annotatorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export default class AnnotatorView extends FileView {
const annotation = await getAnnotation(annotationId, this.file, this.app.vault);
if (!annotation) return;
let yoffset = -10000;
let done = false;
let newYOffset;
const isPageNote = !annotation.target?.length;
const selectors = new Set(isPageNote ? [] : annotation.target[0].selector.map(x => JSON.stringify(x)));
Expand Down Expand Up @@ -277,7 +278,6 @@ export default class AnnotatorView extends FileView {
'showAnnotations',
matchingAnchors.map(x => x.annotation.$tag)
);
let done = false;
switch (annotationTargetType) {
case 'pdf':
for (const anchor of matchingAnchors) {
Expand Down