Repository navigation
Dimension tool: edit the dimension text (<> = measured value) - #1931
lewandowskit wants to merge 3 commits into
Conversation
…ngth, angle, radius and diameter annotations
The dialog's section titles, field labels, choices and hints, and the dimension commands' error messages, had no Polish rows (they are passed to `tl!` through helper functions). 36 rows added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DukHNvUY45rjRnvtz91x33
Double-click a dimension (Selection, Direct Selection, Group Selection or
the Dimension tool), or choose Object › Dimensions › Edit Dimension
Text…, to type what the dimension shows instead of its measurement, as
drawings that are not to scale or that need tolerances call for. `<>`
stands for the measured value (`<> ±0.5`, `ok. <>`); an empty field shows
the measurement again. The measurement keeps following the measured art,
so `<>` stays live.
- `Dimension.text` (saved in native files only when set) and
`measured_label()`; `label()` applies the text.
- `dimension.create` and `dimension.update` take `text` (string, or ""
/ null for the measurement); one line of at most 256 characters.
- The Edit Dimension Text dialog shows the measurement, the text field
and a live preview, with Use Measured Value; UI command
`dimension.editText {id?}`.
- Strings translated into every catalog; the new message into every
complete one.
Closes storytold#1916. Builds on storytold#1788 (Dimension tool).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DukHNvUY45rjRnvtz91x33
Messhias
left a comment
There was a problem hiding this comment.
cargo xtask ci is incomplete or unchecked on this PR. Run it end to end (fmt, clippy, tests, assets, brands, layers, wasm), tick the checklist when green, and reply here with the outcome. That is required before any approve from here.
|
@Messhias ran |
|
Thanks @lewandowskit, and thanks for opening #1916 first. I'm holding this for the owner's decision in #1916, as you expected. The reference app's public documentation for the Dimension tool lists Units, Precision, Scale, Hide Units, the arrow and line settings, the font and the text position, and says existing dimensions change through the Properties panel. It doesn't describe typing your own text over the measurement, so a text override is a new option, and that's the owner's call. If it's approved: #1788 has landed since, so the branch needs a rebase that drops #1788's commit, and the new strings need rows in bg and pt-br too (both are complete catalogs now). Join us on Discord: https://discord.gg/artcraft |
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: the Dimension tool lets the user edit the dimension text, with <> standing for the measured value (as in AutoCAD and Illustrator's dimension text conventions). A new document module dimension.rs holds persistent dimension recipes whose children are ordinary paths and type for all renderers and exporters. contributors/people.toml gains an entry for a different person (osamaamin2011) than the PR's author, which looks like another branch's change and should be checked. A user-edited text containing <> must substitute the current measurement every time the geometry changes, and a literal <> needs an escape. The recipe is saved in the document and unknown versions must degrade to the plain drawing. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
…ort lists The Polish catalog lacked a row for 1,854 of the status and error messages that the untranslated report finds in the sources, so the status bar showed those messages in English. - pl.tsv gains 1,808 `@msg` rows: the errors of commands and their parameter checks, scripts, file import and export, printing and plug-ins. The translations are VectorCraft's own, written from the English meaning with the catalog's conventions and its existing feature names. Placeholders, parameter names, command ids and literal values stay as the English writes them. - 44 of the others get their Polish rows from open #7211, #7214, #7116, #7330 and #1931, so this change leaves them out. 2 are messages that no catalog has a row for yet. Menu strings, `tl!` literals, undo labels and swatch names are unchanged. - Two of the messages have two placeholders in a row. The catalog does not load such a row, so those two are still shown in English. - The Polish row of docs/localization-parity.md gives the catalog's current counts. Docs: docs/target-app-parity.md, docs/localization-parity.md.
Closes #1916. Builds on #1788 (Dimension tool by @osamaamin2011), so this PR also shows its commit; the new work is the last two commits:
6b7b7bei18n(pl): the 36 Dimension-tool strings still untranslated in Polish.fae5955Dimensions: type your own text over the measurement.Rebased onto current
main(#1788's commit included, with its translation-catalog anddoc/src/lib.rsconflicts resolved by keeping both sides). Once #1788 lands I'll rebase so only these remain. @osamaamin2011, if you'd rather take them into your branch, feel free to cherry-pick.What
Double-click a dimension (Selection, Direct Selection, Group Selection or the Dimension tool), or choose Object › Dimensions › Edit Dimension Text…, and type what the dimension shows instead of its measurement.
<>stands for the measured value:<> ±0.5→1200 mm ±0.5approx. <>→approx. 1200 mm1200 mm→ replaces the number (drawings not to scale)The measurement keeps following the measured art, so
<>stays live; undo, save and open keep the text.Why
In sign and print work we dimension customer drawings all the time, and they are often not to scale (a 6 m façade sign sketched on A4) or need a tolerance, a note or a rounded value. Today a placed dimension's number can't be changed without ungrouping it and losing the link. CAD tools and CorelDRAW call this a text override. It isn't in Illustrator's documented Dimension tool, so it's the owner's call (#1916).
How
Dimension.text: Option<String>(serialized only when set);measured_label()is the old label,label()applies the text.dimension.create/dimension.updatetaketext(string;""or null = the measurement), validated as one line of at most 256 characters.dimensionText: measured value, text field, live preview, Use Measured Value; UI commanddimension.editText {id?}and the Object › Dimensions menu item.Tests
typed_text_replaces_the_label_keeps_following_the_source_and_resets,typed_text_is_one_short_line(all 13 dimension tests pass).opens_on_a_dimension_part_and_types_over_the_measurement; i18n and menu tests pass.maina067177.cargo fmt --checkclean; clippy clean for this change (main's existingmanual_range_containsinthumb_worker.rsis untouched).Code drafted with AI assistance; I'm a native Polish speaker for the translations.
Checklist
cargo xtask cipasses — fmt, clippy, tests, assets, brands, layers and wasm, on macOS (Mac mini M4). One existing test unrelated to this PR fails on macOS only and was skipped, as in Info panel: the selection's area (m²) for print and sign work #1905:vectorcraft-mcpremote_does_not_send_on_a_connection_with_a_stray_line(see comment).🤖 Generated with Claude Code