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

Draft: Rotation compensation #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

simonschmidt
Copy link

@simonschmidt simonschmidt commented Aug 13, 2024

See #27

  • Compensate when displaying highlights (scaledToViewport)
  • Compensate when creating highlights (viewportToScaled)
  • Can create highlights correctly...

@simonschmidt
Copy link
Author

simonschmidt commented Aug 14, 2024

I added something similar in viewportToScaled but that was not sufficient to make adding highlights work...

I think because in MouseSelection the viewportPosition is not actually in viewport coordinates when we're dealing with rotated pages.

But I'm not sure, I'll leave this issue for the moment as I'm not even sure this is the right approach, maybe there's a way to ignore all the rotation stuff in the first place?

Particularly since currently the highlights component is placed inside the PDF.js textLayer which in turn has the rotation applied to it on CSS level - quite an impedance mismatch.

Would it make more sense to add a separate layer instead that PDF.js doesn't even try to rotate in the first place? (i.e. a div with the same size) Then highlights could just be added in there without knowing or caring about pdf rotation (EDIT: See #30 for this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant