Skip to content

fix(document): apply rotation transform to document annotation layers#744

Open
kduncanhsu wants to merge 1 commit intobox:masterfrom
kduncanhsu:kduncanhsu/annotations-anchored-during-rotation
Open

fix(document): apply rotation transform to document annotation layers#744
kduncanhsu wants to merge 1 commit intobox:masterfrom
kduncanhsu:kduncanhsu/annotations-anchored-during-rotation

Conversation

@kduncanhsu
Copy link
Copy Markdown

@kduncanhsu kduncanhsu commented May 4, 2026

Summary

  • Apply rotation transforms to annotation layers in DocumentAnnotator.renderPage(), mirroring the ImageAnnotator pattern
  • When rotation is non-zero, layers are sized to original (unrotated) page dimensions, centered via translate(-50%, -50%), and rotated to stay anchored to the rotated page content
  • When rotation returns to 0°, inline styles are cleared to restore default SCSS positioning

Companion PR

Test plan

  • Verify annotations (highlight, region, draw, comment pin) stay anchored to page content at 0°, 90°, 180°, 270°
  • Verify annotations display correctly when rotating back to 0°
  • Verify no visual regression for annotations on non-rotated documents

Mirror the ImageAnnotator pattern by applying rotation transforms to
annotation layers in DocumentAnnotator.renderPage(). When rotation is
non-zero, layers are sized to original (unrotated) page dimensions,
centered, and rotated to stay anchored to the rotated page content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kduncanhsu kduncanhsu requested a review from a team as a code owner May 4, 2026 22:46
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Duncan Hsu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants