MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / onPointerMove

Function onPointerMove

frontend/src/managers/drag-toggle.ts:84–105  ·  view source on GitHub ↗
(e: PointerEvent)

Source from the content-addressed store, hash-verified

82}
83
84function onPointerMove(e: PointerEvent) {
85 if (!activeGroup || !source) return;
86
87 const member = findMember(e.target || undefined);
88 if (!member || member.getAttribute("data-drag-toggle-group") !== activeGroup) return;
89
90 // Engages only when the cursor crosses from the source to a different peer, so tiny wobbles over the source don't trigger
91 if (member === source || visited.has(member)) return;
92
93 // First crossing engages the drag and toggles the source as part of the operation
94 if (!engaged) {
95 engaged = true;
96 visited.add(source);
97 if ((source.getAttribute("data-drag-toggle-state") || undefined) === startingState) source.click();
98 }
99
100 // Toggle only peers still in the starting state, so we don't flip ones already at the target state
101 if ((member.getAttribute("data-drag-toggle-state") || undefined) !== startingState) return;
102
103 visited.add(member);
104 member.click();
105}
106
107function onPointerUp() {
108 if (!activeGroup) return;

Callers

nothing calls this directly

Calls 4

findMemberFunction · 0.85
hasMethod · 0.80
clickMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected