Skip to content

Sketch origin marker: distinct display, properties UI, and active-sketch behavior #177

Description

@trailcode

Summary

Enhance the per-sketch Origin reference point with a distinct visual marker, editable position in Sketch properties, and clearer Sketch List integration.

Motivation

Every sketch already has a permanent origin node (from #176), but it looked identical to user-placed Add node markers and was always drawn on all visible sketches. Users need a stable anchor they can recognize, reposition without treating it as geometry, and optionally hide per sketch.

Proposed behavior

Visual marker

  • Origin: + inside a circle on the active sketch only (when enabled)
  • Add node points: red + without a circle (unchanged, all visible sketches)
  • Settings → Sketch → Origin marker color (origin_marker_color, default cyan)

Sketch properties ([P])

  • Show origin marker checkbox (per sketch, saved as show_origin_marker in project JSON)
  • Position X/Y sliders with view-relative range (same pattern as underlay center)
  • Set button beside each slider opens a floating value field (distance-edit style); Enter applies, Esc dismisses
  • Origin position changes do not push undo snapshots (reference annotation, not geometry)

Sketch List consistency

  • Clicking [P] makes that sketch the current sketch (same as the radio button)
  • While Sketch properties is open, the dialog always shows the current sketch (follows radio selection)

Files (expected)

  • sketch_node_marks.*, utl_geom.* — origin marker shape and styling
  • sketch.h / sketch.cpp, sketch_json.cpp — origin position API, show_origin_marker
  • gui.cpp, gui.h, gui_settings.cpp, gui_mode.cpp — properties UI, Set editor, settings color
  • sketch_display.cpp — refresh markers when switching current sketch
  • docs/usage-sketch.md, docs/usage.md, docs/usage-settings.md, src/doc/sketch.md
  • tests/sketch_tests.cpp

Acceptance criteria

  • Origin marker is visually distinct from Add node markers
  • Origin marker visible only on active sketch when Show origin marker is on
  • Origin color configurable in Settings
  • Position editable via sliders and Set popup in Sketch properties
  • [P] activates sketch; properties dialog tracks current sketch
  • Origin remains a snap target even when marker is hidden
  • Docs updated

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions