Skip to content

feat: LaTeX labels, decimal coords, ruler angle, shortcut cheatsheet, arrow keys#35

Merged
DanteCpp merged 3 commits into
mainfrom
feat/latex-labels-coords-ruler-shortcuts
Jul 15, 2026
Merged

feat: LaTeX labels, decimal coords, ruler angle, shortcut cheatsheet, arrow keys#35
DanteCpp merged 3 commits into
mainfrom
feat/latex-labels-coords-ruler-shortcuts

Conversation

@DanteCpp

Copy link
Copy Markdown
Owner

Summary

Five editor improvements, each covered by tests (763 unit tests green, typecheck + lint clean, production build passes).

1. LaTeX in Name/value labels

GraphicPrimitive.drawText now routes $...$ math through layoutMath/drawMathSegments when TeX rendering is active, so macros and every arrow-capable/base primitive render typeset math in their Name and value fields (on-screen and in bitmap/PNG export, which force-enables TeX on the same canvas path). Falls back to plain text when TeX is off or there is no delimiter.

2. Two-decimal coordinate indicator

The X:/Y: readout shows toFixed(2) and is fed unsnapped cursor coordinates, so the decimals carry real sub-grid precision. Snapped placement logic downstream is unchanged.

3. Ruler angle

The ruler measurement box gained a third line: the angle from horizontal (e.g. -53.13°), computed in logical space so it reflects the true drawing geometry regardless of independent X/Y zoom.

4. Keyboard Shortcut cheatsheet (Help menu)

A grouped, scrollable modal listing every shortcut, keys rendered as <kbd> caps. On macOS Ctrl/Alt display as /. Redundant entries were trimmed (Home, Backspace, duplicate Redo) and the non-functional library-macro section removed.

5. Arrowhead shortcuts (new)

Shift+E / Shift+S toggle an end / start arrowhead on any selected arrow-capable primitive (line, Bézier, complex curve). Handled before the single-key tool/transform bindings so they don't fall through to Ellipse/Mirror. Group-consistent toggle, undo-aware, round-trips through save/load for free.

Tests

  • New: test/primitives/name-value-latex.test.ts, test/ui/shortcuts-dialog.test.ts
  • Extended: test/circuit/keyboard-shortcuts.test.ts (arrow toggles), test/circuit/ruler.test.ts (angle), test/ui/toolbar-controller.test.ts (decimal format)

DanteCpp added 3 commits July 15, 2026 20:37
Text primitives can now contain "\n" to render stacked lines, editable
via the in-place canvas editor or the properties panel (both now
textareas). Internally the text stores real newlines; the FidoCad file
format keeps one physical line per primitive by escaping/unescaping
"\n" on save/load, preserving backward compat with existing files that
already contain raw backslashes.

Rendering, bounding-box/hit-testing, rectangle selection, and the SVG/
PDF/PGF/TikZ exporters all stack additional lines below the first.
Math-mode (LaTeX) text is not yet multiline-aware.
Each "\n"-separated line is now laid out through MathLayout
independently, so a text primitive can mix math and plain lines (or
math on every line) while stacking correctly on canvas, in
hit-testing/selection bounds, and in the SVG/PDF exporters (which
already laid out per line). All lines share one line-pitch sized to
the tallest line's ascent/descent so nothing clips or overlaps.
… arrow keys

- Render LaTeX math in macro/primitive Name and value labels (drawText now
  routes $...$ through layoutMath/drawMathSegments when TeX rendering is on)
- Coordinate indicator shows unsnapped X/Y with two decimals
- Ruler measurement box reports the angle from horizontal, in logical space
- Add a Keyboard Shortcuts cheatsheet to the Help menu (macOS shows Command/
  Option); trimmed redundant entries and dropped the non-functional library
  macro section
- New shortcuts: Shift+E / Shift+S toggle an end / start arrowhead on any
  selected arrow-capable primitive (line, Bezier, complex curve)
@DanteCpp
DanteCpp merged commit ccb5c6a into main Jul 15, 2026
9 checks passed
@DanteCpp
DanteCpp deleted the feat/latex-labels-coords-ruler-shortcuts branch July 15, 2026 20:12
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.

1 participant