Skip to content

feat(DIMENSION): add editable measurements on a dedicated layer - #2104

Closed
RICHRAN2030 wants to merge 3 commits into
storytold:mainfrom
RICHRAN2030:feat/dimension-annotations
Closed

RICHRAN2030 wants to merge 3 commits into
storytold:mainfrom
RICHRAN2030:feat/dimension-annotations

Conversation

@RICHRAN2030

Copy link
Copy Markdown

What and why

Add a Dimension tool that leaves editable measurement annotations in the drawing. Users can place linear, angular, radius and diameter dimensions, with explicit rectangle Width/Height modes available in a floating toolbar even when the optional Control bar is hidden.

Annotations automatically go on a dedicated Dimensions layer, preserving the source artwork and its layer. A compact options dialog controls units, precision (format examples 0, 0.0, 0.00, etc.), scale, dimension/extension lines, arrows and text. Selected annotations can be restyled through Properties; native files retain their editable recipes. Each placement or restyle is one undo step.

Measurements are snapshots: changing the source artwork does not automatically remeasure existing annotations. Automatic radial picking supports live circles/circular arcs; arbitrary curves are not fitted. SVG/PDF export retains ordinary vector artwork. Public behaviour references and usage details are in docs/dimension-tool.md.

This PR is independent of Image Trace PR #1879. It includes a separate Rust 1.95 lint-fix commit and a merge of current upstream main, retaining upstream PDF backend changes.

How it was tested

  • Full cargo xtask ci passed on the final merged source tree: all eight gates (fmt, clippy, test, pdf-deps, assets, brands, layers, wasm), 6,607 tests passed.
  • Eleven engine integration tests cover geometry, independent layer creation/reuse, locked/hidden layers, Undo/Redo, editable native roundtrips, SVG export, rectangle bounds and tool interaction.
  • Three tool regressions and five headless UI regressions cover picking/cancellation, defaults, dialog layout, precision display/output and the floating bar with optional chrome disabled. The revised precision control was also visually inspected in a rendered frame.
  • Native Windows UI inspected using an original synthetic rectangle/circle sample. The packaged executable reopened four editable dimensions on the Dimensions layer while preserving two source shapes on their own layer. These package checks preceded the upstream merge; the full gate above covers the merged tree.
  • Fifteen translation catalogs updated; no new production dependencies or bundled assets.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, pdf-deps, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or unimplemented! outside tests; command errors return Result.
  • Clean-room: implemented from public documentation; no Adobe application/code/assets or GPL/AGPL code used.
  • Every new asset has a row in ASSETS.md (no new asset files).

@Messhias Messhias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feat(DIMENSION): add editable measurements on a dedicated layer. Checklist cargo xtask ci is ticked.

@bflatastic

Copy link
Copy Markdown
Member

Thanks @RICHRAN2030 for the work that went into this.

I'm closing it because the Dimension tool has already landed in #1788. It has Linear, Angular and Radial modes, Tool Options, restyling from Properties with Apply to All and Set as Default, and native files keep the recipes. It also does what the reference app's documentation describes: dimensions follow the art they measure when it's transformed. The measurements here are snapshots that don't update, and the reference app's public documentation doesn't describe a dedicated Dimensions layer, so merging this would give us two tools that behave differently.

If the current tool is missing something you need (explicit Width/Height modes for rectangles, for example), please open an issue about it against the current tool.

Join us on Discord: https://discord.gg/artcraft

@bflatastic bflatastic closed this Oct 15, 2026
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