Place a peg's pivot with ⌃/⌘ rather than ⌥
⌥-drag does not survive the trip. Most Linux window managers grab Alt-drag to move the window, so the page never sees the pointer and the gesture is simply absent — on the machine it is absent from, with no error and nothing to find. Reported from one. ⌃ (⌘ on a Mac) now places the pivot, which is the modifier the rest of this stage already reaches for. ⌥ keeps working for anyone whose desktop leaves it alone; ⇧ is deliberately not it, since it means CONSTRAIN everywhere else here — uniform scale, 15° turn steps — and is what a snap to the child's corners will want when this drag grows one. The menu row says so, because a modifier nothing mentions is a modifier nobody finds: "add peg · ⌃/⌘-drag its cross to place the pivot". `peg.mjs` now asserts each modifier through real pointer events instead of reading the handler, which is the only way this class of bug shows up — all three place the pivot with a child drift of 0, and an unmodified drag still translates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HkinzDz1VtahZVsujAGRBD
This commit is contained in:
parent
357ff1f3b9
commit
39c436584b
3 changed files with 93 additions and 39 deletions
|
|
@ -325,9 +325,20 @@
|
|||
;; to 8.8 from the middle, so the disc has to stop short of 5.2.
|
||||
[:circle.peg-grab
|
||||
{:cx px :cy py :r 5
|
||||
;; ⌥ moves the PIVOT instead of the peg, which is the pan-behind
|
||||
;; ⌃/⌘ moves the PIVOT instead of the peg, which is the pan-behind
|
||||
;; split: a plain drag writes `pos` and carries the children with
|
||||
;; it, and that is a translate, not a new pivot.
|
||||
;;
|
||||
;; NOT ⌥, which this was and which does not survive the trip. Most
|
||||
;; Linux window managers grab Alt-drag to move the window, so the
|
||||
;; page never sees the pointer at all and the gesture is simply
|
||||
;; missing — on the machine it is missing from, with no error. ⌥ is
|
||||
;; still accepted for anyone whose desktop leaves it alone, and the
|
||||
;; command key is the one the rest of this stage already reaches for.
|
||||
;;
|
||||
;; ⇧ is deliberately NOT it: it means CONSTRAIN everywhere else
|
||||
;; here — uniform scale, 15° turn steps — and it is what a snap to
|
||||
;; the child's corners would want when this drag grows one.
|
||||
:on-pointer-down
|
||||
(fn [^js event]
|
||||
(.stopPropagation event)
|
||||
|
|
@ -335,7 +346,7 @@
|
|||
(let [svg (.-ownerSVGElement (.-currentTarget event))
|
||||
p (xy svg event (:w ctx) (:h ctx))]
|
||||
(.setPointerCapture svg (.-pointerId event))
|
||||
(if (.-altKey event)
|
||||
(if (or (.-ctrlKey event) (.-metaKey event) (.-altKey event))
|
||||
(reset! repivot {:path path :p p})
|
||||
(begin! ctx :move path p))))}]
|
||||
[:line.knob-arm {:x1 px :y1 (- py r) :x2 px :y2 (- py r 8)}]
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
;; measured part by hand — which is what `gesture/refusal` tells
|
||||
;; you to do, so it has to be reachable from somewhere.
|
||||
{:label "add peg"
|
||||
:sub "A transform node over the selection, to pivot, turn and key from"
|
||||
:sub "A transform node over the selection · ⌃/⌘-drag its cross to place the pivot"
|
||||
:disabled? (nil? one-node)
|
||||
:on-click #(rf/dispatch [::ui/peg one-node])}]}]
|
||||
[snapshots/view]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue