Files
vectorcraft/crates/engine
dotCooCoo 907a759710 Unit Converter: one length in every unit, read from and applied to the selection
Object › Plug-ins › Unit Converter › Unit Converter Panel opens a panel
with one number field per unit of Preferences › Units › East Asian Type
(pt, picas, in, mm, cm, px, ft & in, m, yd, ft, Q, Ha). A length typed in
any field, with units and arithmetic as every number field reads them,
updates the others as it is typed; text that does not read leaves them as
they were. From Selection reads the selection's width and height as the
Transform panel measures them, and Width or Height picks which one the
fields show; the size read is dropped when the document, its selection,
Use Preview Bounds or Measure Type by Glyph Bounds changes. Apply sets
that side through object.setBounds as the Transform panel's W or H field
does (its reference point, Constrain Width and Height Proportions and
Transform Object Only, Pattern Only or Both), as one undo step, and adds
none when the size is already that length. Each field's copy button
copies its value, with its unit when Copy with Units is on, and is named
with its unit for screen readers.

- addon.units.convert {value, unit?} gives a length in every unit, and
  addon.units.selectionSize {} gives the selection's width and height the
  same way. Neither changes the document. convert reads at most 1024
  bytes and 128 + - * / signs.
- The decimal comma rule of the number fields moves from ui-egui to
  vectorcraft_doc::decimal_point, so the command reads "0,5 mm" as the
  fields do.
- The Transform panel's pattern switches are built by
  with_pattern_switches, which run_transform and Apply share.

Closes #5528, as proposed by @ruchirguitar.
2026-11-14 13:02:57 -08:00
..