Commit Graph
22 Commits
Author SHA1 Message Date
KiwiKwiandBabaKush 4a83ec87f5 fix(annot): drop Apple Markup's stale copy when a page's annotations change (#2829)
iOS Markup keeps a private copy of a page's markup (/AAPL:PPK, /AAPL:PPKHash on the page,
/AAPL:AKExtras on each annotation) and draws from it. Once /Annots changes, that copy is stale:
iOS 26 drew a Markup signature twice. Adding, deleting or answering a comment now drops the copy,
records the drop in the repair log, and leaves a refused edit untouched.

The change lives in lookup.rs (change_annots), called from create.rs (add) and modify.rs (delete,
reply, mark). Each of the four operations has a regression test on an Apple Markup page.

Co-authored-by: BabaKush <101988920+BabaKush@users.noreply.github.com>
2026-11-10 12:38:55 +01:00
bflatastic dd72e2e672 Merge #2345: M6: custom stamps can carry a line filled in when they are placed (#1741)
# Conflicts:
#	ROADMAP.md
#	crates/annot/src/lib.rs
2026-11-09 18:23:14 +07:00
bflatastic 88a2ab97ec Merge #4094: M5: a callout's arrow point, knee and text box change on their own (#1152)
# Conflicts:
#	crates/annot/src/info.rs
#	crates/annot/src/modify.rs
#	crates/annot/src/tests.rs
#	crates/automation/src/tools.rs
#	crates/automation/tests/it/automation.rs
#	crates/ui-egui/tests/it/comments.rs
2026-11-09 18:19:26 +07:00
mtlcl410 b8d9497b93 M5: cloudy squares, circles and text boxes are drawn (comment.cloud) (#4195) 2026-11-09 18:32:44 +08:00
mtlcl410 c13acf6d0f Merge upstream/main into feat/callout-reshape-1152
Keeps main's Callout font size preference with the shared callout_knee(),
main's on_text() beside the callout box resizing, and both new inspector
helpers.
2026-11-09 11:43:24 +08:00
BFlat 43f24aa169 Draw Thai in Fill & Sign, text boxes, form fields, headers, footers and watermarks (#6632)
Refs #2354. Thai typed into these tools is shaped and drawn from the Thai face through Add text's writer (now pdfcraft_fonts::shaped_text), searchable and copyable, instead of being written as ?????; a build without a Thai face refuses it with a message.
2026-11-09 02:56:34 +08:00
mtlcl410andClaude Opus 5.5 3243204e96 Merge upstream/main into feat/callout-reshape-1152
Conflicts: exports and imports (annot info.rs, engine lib.rs, the comment
tool's input.rs and paint.rs) take both sides; automation keeps main's
border-shape and opacity fields in comment_list and this PR's callout
points, and comment_edit's description has main's border colour and
opacity text with this PR's callout text box and arrow point and knee.
Main moved the end of a select gesture into `finish_select_gesture`
(multi-selection moves); this PR's callout handling (a drag on the text
box moves the box alone, a resize uses the box's frame, a reshape goes
through `reshape_for`) now lives there, and `changing_points` keeps main's
batch arm next to this PR's resize arms. In annot's tests this PR's
callout helper is `callout_box_of`, since main now imports
`modify::text_box_of` there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-06 02:54:26 +08:00
mtlcl410andClaude Opus 5.5 39d09ff25d Merge upstream/main into feat/dynamic-stamps
Conflict in crates/engine/src/edit/run.rs: main added the PasteComments
arm next to AddCustomStamp; both are kept, AddCustomStamp with this PR's
text line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-06 02:14:59 +08:00
496e37d72b M5: text boxes and typed text take an oval or a circle for their border (#4543)
* Fill & Sign: a Border control for typed text, and a border colour of its own

Rebased onto main as one commit: main's Fill & Sign text colour (#2444) runs through the
same places as the border (the open box, typed(), the page input, the toolbar and the
preferences), so every step of the branch met it again. Text colour and border now travel
together as TypedLook (typed_with), which keeps typed() and the new function under Clippy's
argument limit; a border without its own colour takes the text's. Make Current Properties
Default on typed text also keeps its colour for new text now.

The branch's commits, in order:
- Typewriter text: a border change grows its box on every side, so the text keeps its place
- Fill & Sign: a Border control for typed text and dates
- Parity: the typewriter border's evidence
- i18n: the Border label in every catalog, recorded in ATTRIBUTION.toml
- Text boxes, typewriter text and callouts: a border colour of their own
- Fill & Sign: the toolbar follows the selected text; a Border colour button
- fill_sign_add and comment_edit take `border_color`
- Parity: the border colour and the toolbar following the selection
- i18n: Border colour and Same as text in every catalog, recorded in ATTRIBUTION.toml
- Typed text's border: /Border's width is read, a non-finite border colour refused, a saved Same as text restored
- Fill & Sign: the toolbar changes only the selected text; Make Current Properties Default keeps new text's border
- Review: Make Properties Default gives a text box's or callout's tool its border colour
- i18n: the new labels in the Persian catalog, recorded in ATTRIBUTION.toml
- Review: a test that dragging the Font size control resizes the selected text to where the drag ends
- Rebase: the typed text's border in main's annot and comments modules (Style's border colour, exports), and craft_ui's ComboBox

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* M5: text boxes and typed text take an oval or a circle for their border

Rebased onto #4146's new head as one commit (see there: main's Fill & Sign text colour runs
through the same places). The border shape goes into TypedLook's border with the width and
colour; a circle around typed text still takes the snug box.

The branch's commits, in order:
- Text boxes and typed text take an oval or a circle for their border
- A circle goes snug around its text
- Review: fill_sign_add takes an oval or a circle only with a border
- Review: a circle made on a quarter-turned page is sized from the text as shown
- Review: Border ▸ None takes an oval or a circle away with the line
- Review: the Border colour button shows the selected text box's own colour
- i18n: Border shape in the Persian catalog, recorded in ATTRIBUTION.toml
- Review: Border ▸ None on a circled text is one undo step
- Rebase: the border shape in main's annot, engine and comments modules; craft_ui's ComboBox; Fill & Sign's border controls in a function of their own (main's complexity limit)
- Review: Thickness 0 in Comment Properties takes an oval or a circle away, as Border ▸ None does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Open the Font size popup first in the drag test: main moved the size into a popup

* Border shape per selected comment, and split the oval/circle border out of draw_free_text (clippy cognitive complexity)

* Re-run CI (the push of the main merge did not start it)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-05 17:32:01 +01:00
0839c1e761 Fill & Sign: a Border control for typed text, and a border colour of its own (#4146)
* Fill & Sign: a Border control for typed text, and a border colour of its own

Rebased onto main as one commit: main's Fill & Sign text colour (#2444) runs through the
same places as the border (the open box, typed(), the page input, the toolbar and the
preferences), so every step of the branch met it again. Text colour and border now travel
together as TypedLook (typed_with), which keeps typed() and the new function under Clippy's
argument limit; a border without its own colour takes the text's. Make Current Properties
Default on typed text also keeps its colour for new text now.

The branch's commits, in order:
- Typewriter text: a border change grows its box on every side, so the text keeps its place
- Fill & Sign: a Border control for typed text and dates
- Parity: the typewriter border's evidence
- i18n: the Border label in every catalog, recorded in ATTRIBUTION.toml
- Text boxes, typewriter text and callouts: a border colour of their own
- Fill & Sign: the toolbar follows the selected text; a Border colour button
- fill_sign_add and comment_edit take `border_color`
- Parity: the border colour and the toolbar following the selection
- i18n: Border colour and Same as text in every catalog, recorded in ATTRIBUTION.toml
- Typed text's border: /Border's width is read, a non-finite border colour refused, a saved Same as text restored
- Fill & Sign: the toolbar changes only the selected text; Make Current Properties Default keeps new text's border
- Review: Make Properties Default gives a text box's or callout's tool its border colour
- i18n: the new labels in the Persian catalog, recorded in ATTRIBUTION.toml
- Review: a test that dragging the Font size control resizes the selected text to where the drag ends
- Rebase: the typed text's border in main's annot and comments modules (Style's border colour, exports), and craft_ui's ComboBox

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Open the Font size popup first in the drag test: main moved the size into a popup

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-05 17:08:08 +01:00
c3c36f77cf M5: a comment's text, border or line, and fill each at an opacity of its own (#4542)
* A comment's text, border or line, and fill each at an opacity of its own

Comment Properties showed one opacity for a whole comment, so a text box's
see-through background took its text and border with it, and a rectangle
marking an area on a plan couldn't have an opaque line over a faint fill.
Now a text box, typewriter text or callout has a Text, Border and Fill
opacity, a rectangle, oval, polygon or cloud a Line and Fill opacity (a part
not drawn is greyed); everything else keeps one Opacity.

The line's stays /CA, the fill's is /ca (PDF 2.0's opacity for what is
filled) and the text's /PCTextOpacity, each only where it differs from the
one it would follow, and the appearance draws them with /GS0 (strokes at the
line's, fills at the fill's) and /GS1 for the text, so every viewer shows
them. The quick bar's Opacity and StyleAnnotation's set the whole comment's.

Engine: Style::{fill_opacity, text_opacity}, Edit::PartOpacity,
annot::{set_part_opacity, appearance::part_opacity}, Props::{fill_opacity,
text_opacity}. Make Properties Default and the settings carry the parts.
Headless: comment_add / comment_edit fill_opacity, text_opacity; comment_list
reports opacity, fill_opacity, text_opacity. Four labels in every catalog
(AI-assisted translations from English, noted in ATTRIBUTION.toml).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Review: the text's opacity slider shows what the text is drawn at; comment_list skips replies' properties; ui-parity's change record

A text box without fill and border whose text kept an opacity of its own showed the border's
in its Text opacity slider; it now shows the text's, and a change sets the whole comment's.
The opacity sliders are named by their labels. comment_list reads a comment's properties only
for comments, not for every reply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rebase: comment_list tells replies by is_reply, as main now threads them

main threads replies by their /IRT reference (#4061); the opacity fields skip a reply the
same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Review: a text-only text box made default gives the tool its text's opacity

With neither a border nor a fill, a text box's text is the whole comment:
Comment Properties shows its drawn opacity (the text's own, when set), and a
change there sets the whole comment's. Make Properties Default, and the
context menu's Make Current Properties Default, stored /CA instead, so a
text box whose text was at 50 % gave the tool 100 %. The default is now the
text's drawn opacity in that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rebase: the part opacities in main's annot layout (Style's fields, the text box drawing's parts, set_part_opacity exported)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rebase: main's new comment test builds a Style with the part opacities

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-05 14:39:36 +01:00
mtlcl410andClaude Opus 5.5 4a89a456d0 Merge storytold/pdfcraft main into feat/dynamic-stamps
Conflicts:
- crates/engine/src/tests.rs: both sides added tests at the end of the
  file. Kept this branch's three stamp-line tests and main's page-deletion
  save and image-transform tests; the closing braces after the markers are
  shared, so the branch's last test gets its own.
- crates/ui-egui/src/i18n/{ca,fi,hi,id,ko,nb,ro,sq,th,vi}.tsv: both sides
  added rows at the same place. Kept both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-02 16:24:08 +08:00
mtlcl410andClaude Opus 5.5 512eee1316 Merge storytold/pdfcraft main into feat/callout-reshape-1152
Conflicts:
- crates/annot/src/modify.rs: the create imports; kept this branch's
  callout helpers and main's ink_bounds.
- crates/annot/src/tests.rs: both sides added tests at the same place
  (the callout tests here, main's freehand highlight test); kept both.
- crates/automation/tests/it/automation.rs, crates/ui-egui/tests/it/comments.rs,
  crates/ui-egui/src/tools/comments/tests.rs: both sides added tests or
  helpers at the same place; kept both, each with its own closing brace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-02 12:18:38 +08:00
mtlcl410andClaude Opus 5.5 95ba736d66 M5: a callout knee with a coordinate that isn't a number takes the bottom side whatever the other
callout_side's doc says a coordinate that isn't a number takes the bottom
side, but every comparison with NaN is false, so the other coordinate
alone decided: [NaN, y above the box] gave Top, [x left of it, NaN] Left.
A NaN coordinate is now checked before any comparison.

Review on #4094 (CodeRabbit, crates/annot/src/create.rs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-02 09:07:57 +08:00
archamon faebcfd264 fix(annot,ui): stabilize ink width bounds, search translated tool labels, and fix hotbar settings label 2026-11-01 20:58:16 +00:00
archamon 53c79ca9b0 feat(ui,annot): customizable hotbar strip, freehand highlight, and moveable navigation rail
- Add Freehand-Highlight tool with 100pt line width support, Lucide highlighter icon, and PDF Multiply blending.
- Add customizable floating and docked hotbar with command picker, size slider, full-side strip chrome integration, and settings gear icon anchored at the bar end.
- Add left/right docking options for the navigation rail with toggle button and preferences setting.
2026-11-01 20:23:12 +00:00
mtlcl410andClaude Opus 5.5 9d38c80b8a M5: a callout's knee on the box's outline meets the side it is on (#1152)
callout_side gave every position a side, but a knee exactly on the left,
right or top edge, or on a corner, took the bottom side, and the leader
line was drawn across the box. A knee on the outline (or within 0.01 pt
inside it, as the page hands positions back as f32) now meets the side
whose edge it lies on, a corner the left or right side as beside the box.
Inside the box, or with a coordinate that isn't a number, it meets the
bottom side. The rule is written out on callout_side and every tie is
tested.

Tests also pin the /CL invariant (ISO 32000-2 Table 177: four or six
numbers): four- and six-number callouts keep their count through the
arrow point, knee, box move, box resize, whole move and save/reopen, and
ten malformed /CL values are refused, left as they were by a resize and
shifted in place by a move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-01 19:52:38 +08:00
mtlcl410andClaude Opus 5.5 22d0e4cc4e M6: a lined custom stamp keeps its layout on quarter-turned pages (#1741)
On a page turned 90 or 270 degrees the stamp's rectangle has its sides
swapped in user space, and the appearance is counter-rotated so viewers fit
its turned bounding box to /Rect (ISO 32000-2 12.5.5). The lined layout was
computed in user-space axes, so that fit scaled the two displayed axes
differently: the picture came out squashed and the band stretched.

The layout is now made in the displayed box (the rectangle with its sides
swapped) and the stamp records the page's turn in /PCPictureRotate, so the
appearance carries the counter-rotation itself and a later restyle rebuilds
it the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:29 +08:00
mtlcl410andClaude Opus 5.5 528357a38e M6: custom stamps can carry a line filled in when they are placed (#1741)
Create Custom Stamp offers an optional line under the picture, a
template with {name}, {date} and {time} filled in when the stamp is
placed, in the built-in dynamic stamps' format, and kept with the stamp
library. The picture keeps its shape above the line and the stamp widens
to fit the line. stamp_custom takes the same line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:52:29 +08:00
mtlcl410andClaude Opus 5.5 adc0b91b1e M5: callouts reshape by their arrow point, knee and text box, ported onto main (#1152)
A single squashed port of the branch's seven commits onto current main, which
split the files this touched into modules: annot (create.rs, modify.rs,
info.rs), render inspect (model.rs, annotations.rs), engine comments.rs and
ui-egui tools/comments/*. The behaviour and tests are the branch's:

- a callout's arrow point and knee have handles and move on their own; its
  line follows the box as Acrobat's does; its text box resizes;
- comment_list gives a callout's points and text box, comment_edit reshapes it;
- /CL is read all or nothing, and a box sent back as f32 still moves or keeps
  its line.

On main, select_input's knee cursor moved into point_cursor to stay under the
cognitive-complexity limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 08:01:02 +08:00
Dylan M. Taylor 7d1ed99f51 Refactor annot for strict Clippy checks 2026-10-27 23:12:50 +00:00
aiongg 5ce4d24412 refactor(annot): split lib.rs into src/
New modules: types, lookup, create, modify, draw, info.
2026-10-26 22:18:50 +00:00