Repository navigation
fix(annot): draw callouts upright on rotated pages - #5354
Draft
ExpandYourself wants to merge 1 commit into
Draft
ExpandYourself wants to merge 1 commit into
ExpandYourself wants to merge 1 commit 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
Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.