Repository navigation
fix(annot): draw callouts upright on rotated pages - #5354
ExpandYourself wants to merge 3 commits into
Conversation
Callouts skipped the rotation text boxes already use, so a box on a turned page was laid out sideways.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Keep the upright-callout test beside the freehand-highlight test main added.
Main had moved on. The merge is clean and the upright callout on a rotated page is unchanged.
What this changes
Fixes #4686.
A callout on a page with
/Rotate90, 180 or 270 was laid out in user space and skipped the/PCTextRotateturn that text boxes already get, so the box looked sideways. A new callout now uses that same turn. Its leader and text box are mapped into the displayed frame, and the UI picks the leader side in view space.Supersedes #4690. That branch no longer merges; the comments UI has since moved from
comments.rstotools/comments/composer.rs. This is the same behaviour on currentmain.Existing callouts saved without
/PCTextRotatekeep their current look. Unrotated pages are unchanged.How you verified it
cargo test -p pdfcraft-annot callout— 4 passed, includingcallout_on_a_turned_page_is_drawn_upright_as_displayedand the three existing callout tests.cargo fmt -p pdfcraft-annot -p pdfcraft-ui-egui -- --checkcargo fmt --checkclippy with
-D warningson the crates I changedtests pass on the crates I changed
cargo xtask layersandcargo xtask assets(no crate boundary or asset change)Tests.
crates/annot/src/tests.rs::callout_on_a_turned_page_is_drawn_upright_as_displayedadds a callout to a page with/Rotate90 and checks/PCTextRotate, the form/Matrix, and that the leader starts at the pointed-at spot in the displayed frame.Never-crash
unwrap/expect/panic!/unreachable!/todo!outside tests, unless it is provably infallible with a comment saying whyget, and strings only at char boundaries); checked or saturating arithmetic; allocations sized by input are capped; recursion is boundedunsafeProvenance
ATTRIBUTION.tomlentry andcargo xtask assetspasses (no new asset)Security
--rootconfinement still holds on every path, including ones reached by nested tool dispatchParity and reach
parity/acrobat-features.tomlupdated in this PR, withnotessaying what is still missing.shippedmeans "exists and tested", not "as good as Acrobat"automationtool where that applies (AGENTS.md§3), so agents can drive it and not just the UI (comment_add/add_annotationsets/PCTextRotatefrom the page)docs/, crate README) (parity notes only)Anything a reviewer should look at first
/PCTextRotateare left alone./Rotate0, are unchanged./CLand/RDstay in user space.