openpencil/crates/openpencil-shell-native
Kayshen-X e2aff6c542 feat(shell): canvas click-to-select + drag-to-move
The canvas was pan-only; nodes could only be selected from the
LayerPanel and never moved without editing X/Y in the property
panel. Now:

* Document::node_at_doc_point walks the active page top-most-first
  and returns the topmost node whose aggregate bounds contain the
  document-space point. Children are tested before parents so a
  click on a button-rect inside a Frame selects the rect, not the
  Frame.

* Document::translate_selected moves the selected node by (dx, dy)
  document px. Leaf nodes update bounds.origin directly; container
  nodes (Group / unbounded Frame) translate every descendant that
  carries bounds, so dragging a Group moves the whole subtree.

* WidgetHostNative tracks a NodeDragState. Press over a node ⇒
  select + start node-drag. Cursor-move converts the screen-space
  delta to document space via the live zoom (no canvas_region
  offset needed because deltas are translation-invariant) and
  calls translate_selected. Release clears the drag.

* The Hand tool keeps its pure-pan behaviour. Empty-canvas press
  with any other tool clears the selection + starts a pan-drag,
  same as before.
2026-05-10 23:23:28 +08:00
..
examples refactor(shell): promote inspector_window to openpencil-desktop binary crate 2026-05-10 19:50:10 +08:00
notes feat(shell-native): Step 1a Task 4 — basic_window demo + acceptance + Phase C Gate 2026-05-05 22:39:00 +08:00
src feat(shell): canvas click-to-select + drag-to-move 2026-05-10 23:23:28 +08:00
tests refactor(shell-native): finish v19.4 cleanup — drop orphan event/ + stale test 2026-05-08 22:03:34 +08:00
Cargo.toml docs(shell-native): correct stale Cargo.toml comment about Invariant 2 2026-05-10 10:17:10 +08:00