copper3d 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Utils/segmentation/DragOperator.js +5 -0
- package/dist/Utils/segmentation/DragOperator.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/EventRouter.d.ts +27 -0
- package/dist/Utils/segmentation/eventRouter/EventRouter.js +88 -15
- package/dist/Utils/segmentation/eventRouter/EventRouter.js.map +1 -1
- package/dist/bundle.esm.js +96 -18
- package/dist/bundle.umd.js +96 -18
- package/dist/types/Utils/segmentation/eventRouter/EventRouter.d.ts +27 -0
- package/package.json +1 -1
|
@@ -25,6 +25,11 @@ export class DragOperator {
|
|
|
25
25
|
this.container.style.cursor = "";
|
|
26
26
|
this.container.removeEventListener("pointerdown", this.dragPrameters.handleOnDragMouseDown, true);
|
|
27
27
|
this.container.removeEventListener("pointerup", this.dragPrameters.handleOnDragMouseUp, true);
|
|
28
|
+
// A drag already in flight keeps its pointermove binding, and pointerup —
|
|
29
|
+
// the only thing that detaches it — has just been removed. Without this the
|
|
30
|
+
// listener survives the button release and slices keep scrubbing on hover
|
|
31
|
+
// until the next click happens to land while drag mode is configured again.
|
|
32
|
+
this.container.removeEventListener("pointermove", this.dragPrameters.handleOnDragMouseMove, false);
|
|
28
33
|
this.setIsDrawFalse(1000);
|
|
29
34
|
};
|
|
30
35
|
this.container = container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragOperator.js","sourceRoot":"","sources":["../../../src/Utils/segmentation/DragOperator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,MAAM,OAAO,YAAY;IAoCvB,YACE,SAAsB,EACtB,UAAqB,EACrB,UAAoB,EACpB,aAAyB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AC;IAED,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,gBAAgB,CAAC,WAAmB;QAClC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;IAED,0BAA0B;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,0BAA0B,EAAE,CAAC;IACzD,CAAC;IAuCD,eAAe,CAAC,aAAkB;QAChC,IAAI,CAAC,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -39,6 +39,7 @@ export declare class EventRouter {
|
|
|
39
39
|
private boundPointerLeave;
|
|
40
40
|
private boundWheel;
|
|
41
41
|
private boundContextMenu;
|
|
42
|
+
private boundWindowBlur;
|
|
42
43
|
private isBound;
|
|
43
44
|
constructor(config: EventRouterConfig);
|
|
44
45
|
/**
|
|
@@ -147,6 +148,32 @@ export declare class EventRouter {
|
|
|
147
148
|
* Register wheel handler.
|
|
148
149
|
*/
|
|
149
150
|
setWheelHandler(handler: WheelHandler): void;
|
|
151
|
+
/**
|
|
152
|
+
* Apply the draw modifier going down. Shared by the keydown listener and
|
|
153
|
+
* the pointer-event reconciliation below.
|
|
154
|
+
*/
|
|
155
|
+
private applyDrawKeyDown;
|
|
156
|
+
/** Apply the draw modifier going up. */
|
|
157
|
+
private applyDrawKeyUp;
|
|
158
|
+
/** Apply the contrast modifier going down. */
|
|
159
|
+
private applyContrastKeyDown;
|
|
160
|
+
/**
|
|
161
|
+
* Correct the tracked modifier state from a mouse/wheel event.
|
|
162
|
+
*
|
|
163
|
+
* Keyboard listeners are bound to the container, so they only fire while it
|
|
164
|
+
* holds focus. Clicking a panel input moves focus away, and the container
|
|
165
|
+
* then never sees the Shift keydown: `shiftHeld` stays false, the mode stays
|
|
166
|
+
* `idle`, and the next left-drag scrubs slices instead of painting. Mouse
|
|
167
|
+
* events carry the true OS modifier state on every dispatch no matter where
|
|
168
|
+
* focus sits, which makes them the authoritative correction.
|
|
169
|
+
*
|
|
170
|
+
* Contrast is only ever cleared here, never toggled — the Ctrl toggle lives
|
|
171
|
+
* on keyup in DrawToolCore, and driving it from pointer movement would flip
|
|
172
|
+
* contrast on gestures the user never aimed at the canvas.
|
|
173
|
+
*/
|
|
174
|
+
private syncModifiersFromPointer;
|
|
175
|
+
/** Drop latched modifiers when the window loses focus. */
|
|
176
|
+
private handleWindowBlur;
|
|
150
177
|
private handleKeyDown;
|
|
151
178
|
private handleKeyUp;
|
|
152
179
|
private handlePointerDown;
|
|
@@ -64,6 +64,7 @@ export class EventRouter {
|
|
|
64
64
|
this.boundPointerLeave = this.handlePointerLeave.bind(this);
|
|
65
65
|
this.boundWheel = this.handleWheel.bind(this);
|
|
66
66
|
this.boundContextMenu = (e) => e.preventDefault();
|
|
67
|
+
this.boundWindowBlur = this.handleWindowBlur.bind(this);
|
|
67
68
|
}
|
|
68
69
|
// ========================================
|
|
69
70
|
// Lifecycle Methods
|
|
@@ -89,6 +90,9 @@ export class EventRouter {
|
|
|
89
90
|
this.canvas.addEventListener('wheel', this.boundWheel, { passive: false });
|
|
90
91
|
// Disable right-click context menu
|
|
91
92
|
this.canvas.addEventListener('contextmenu', this.boundContextMenu);
|
|
93
|
+
// Alt-tabbing away swallows the keyup, so held modifiers would stay
|
|
94
|
+
// latched until the key is pressed and released again.
|
|
95
|
+
window.addEventListener('blur', this.boundWindowBlur);
|
|
92
96
|
this.isBound = true;
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
@@ -111,6 +115,7 @@ export class EventRouter {
|
|
|
111
115
|
this.canvas.removeEventListener('wheel', this.boundWheel);
|
|
112
116
|
// Context menu
|
|
113
117
|
this.canvas.removeEventListener('contextmenu', this.boundContextMenu);
|
|
118
|
+
window.removeEventListener('blur', this.boundWindowBlur);
|
|
114
119
|
this.isBound = false;
|
|
115
120
|
}
|
|
116
121
|
// ========================================
|
|
@@ -332,22 +337,82 @@ export class EventRouter {
|
|
|
332
337
|
// ========================================
|
|
333
338
|
// Internal Event Handlers
|
|
334
339
|
// ========================================
|
|
340
|
+
/**
|
|
341
|
+
* Apply the draw modifier going down. Shared by the keydown listener and
|
|
342
|
+
* the pointer-event reconciliation below.
|
|
343
|
+
*/
|
|
344
|
+
applyDrawKeyDown() {
|
|
345
|
+
this.state.shiftHeld = true;
|
|
346
|
+
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
347
|
+
// Also block when sphereBrush or sphereEraser is active
|
|
348
|
+
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
349
|
+
this.setMode('draw');
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/** Apply the draw modifier going up. */
|
|
353
|
+
applyDrawKeyUp() {
|
|
354
|
+
this.state.shiftHeld = false;
|
|
355
|
+
if (this.mode === 'draw') {
|
|
356
|
+
this.setMode('idle');
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/** Apply the contrast modifier going down. */
|
|
360
|
+
applyContrastKeyDown() {
|
|
361
|
+
if (!this.contrastEnabled)
|
|
362
|
+
return;
|
|
363
|
+
// Block contrast state when crosshair, draw, aiAssist, or any sphere-family tool is active (mutual exclusion)
|
|
364
|
+
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
365
|
+
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
366
|
+
this.state.ctrlHeld = true;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Correct the tracked modifier state from a mouse/wheel event.
|
|
371
|
+
*
|
|
372
|
+
* Keyboard listeners are bound to the container, so they only fire while it
|
|
373
|
+
* holds focus. Clicking a panel input moves focus away, and the container
|
|
374
|
+
* then never sees the Shift keydown: `shiftHeld` stays false, the mode stays
|
|
375
|
+
* `idle`, and the next left-drag scrubs slices instead of painting. Mouse
|
|
376
|
+
* events carry the true OS modifier state on every dispatch no matter where
|
|
377
|
+
* focus sits, which makes them the authoritative correction.
|
|
378
|
+
*
|
|
379
|
+
* Contrast is only ever cleared here, never toggled — the Ctrl toggle lives
|
|
380
|
+
* on keyup in DrawToolCore, and driving it from pointer movement would flip
|
|
381
|
+
* contrast on gestures the user never aimed at the canvas.
|
|
382
|
+
*/
|
|
383
|
+
syncModifiersFromPointer(ev) {
|
|
384
|
+
if (ev.shiftKey !== this.state.shiftHeld) {
|
|
385
|
+
if (ev.shiftKey) {
|
|
386
|
+
this.applyDrawKeyDown();
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
this.applyDrawKeyUp();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const ctrlDown = ev.ctrlKey || ev.metaKey;
|
|
393
|
+
if (ctrlDown !== this.state.ctrlHeld) {
|
|
394
|
+
if (ctrlDown) {
|
|
395
|
+
this.applyContrastKeyDown();
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
this.state.ctrlHeld = false;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
/** Drop latched modifiers when the window loses focus. */
|
|
403
|
+
handleWindowBlur() {
|
|
404
|
+
if (this.state.shiftHeld) {
|
|
405
|
+
this.applyDrawKeyUp();
|
|
406
|
+
}
|
|
407
|
+
this.state.ctrlHeld = false;
|
|
408
|
+
}
|
|
335
409
|
handleKeyDown(ev) {
|
|
336
410
|
// Update state based on modifier keys
|
|
337
411
|
if (ev.key === this.keyboardSettings.draw) {
|
|
338
|
-
this.
|
|
339
|
-
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
340
|
-
// Also block when sphereBrush or sphereEraser is active
|
|
341
|
-
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
342
|
-
this.setMode('draw');
|
|
343
|
-
}
|
|
412
|
+
this.applyDrawKeyDown();
|
|
344
413
|
}
|
|
345
414
|
if (this.contrastEnabled && this.keyboardSettings.contrast.includes(ev.key)) {
|
|
346
|
-
|
|
347
|
-
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
348
|
-
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
349
|
-
this.state.ctrlHeld = true;
|
|
350
|
-
}
|
|
415
|
+
this.applyContrastKeyDown();
|
|
351
416
|
}
|
|
352
417
|
// Route to external handler
|
|
353
418
|
if (this.keydownHandler) {
|
|
@@ -357,10 +422,7 @@ export class EventRouter {
|
|
|
357
422
|
handleKeyUp(ev) {
|
|
358
423
|
// Update state based on modifier keys
|
|
359
424
|
if (ev.key === this.keyboardSettings.draw) {
|
|
360
|
-
this.
|
|
361
|
-
if (this.mode === 'draw') {
|
|
362
|
-
this.setMode('idle');
|
|
363
|
-
}
|
|
425
|
+
this.applyDrawKeyUp();
|
|
364
426
|
}
|
|
365
427
|
if (this.keyboardSettings.contrast.includes(ev.key)) {
|
|
366
428
|
this.state.ctrlHeld = false;
|
|
@@ -376,6 +438,9 @@ export class EventRouter {
|
|
|
376
438
|
}
|
|
377
439
|
}
|
|
378
440
|
handlePointerDown(ev) {
|
|
441
|
+
// Must run before the mode is read below: a Shift press the container
|
|
442
|
+
// never received would otherwise leave this reading as a slice-drag.
|
|
443
|
+
this.syncModifiersFromPointer(ev);
|
|
379
444
|
if (ev.button === 0) {
|
|
380
445
|
this.state.leftButtonDown = true;
|
|
381
446
|
}
|
|
@@ -393,6 +458,9 @@ export class EventRouter {
|
|
|
393
458
|
}
|
|
394
459
|
}
|
|
395
460
|
handlePointerMove(ev) {
|
|
461
|
+
// Hovering back over the canvas is the first chance to notice a Shift
|
|
462
|
+
// that was pressed or released while focus sat in a panel field.
|
|
463
|
+
this.syncModifiersFromPointer(ev);
|
|
396
464
|
// Route to external handler
|
|
397
465
|
if (this.pointerMoveHandler) {
|
|
398
466
|
this.pointerMoveHandler(ev);
|
|
@@ -415,6 +483,10 @@ export class EventRouter {
|
|
|
415
483
|
if (this.pointerUpHandler) {
|
|
416
484
|
this.pointerUpHandler(ev);
|
|
417
485
|
}
|
|
486
|
+
// Reconciled last on release so an in-progress stroke finalises under
|
|
487
|
+
// the mode it started in, rather than being cut short by a Shift the
|
|
488
|
+
// user let go of a moment before the button.
|
|
489
|
+
this.syncModifiersFromPointer(ev);
|
|
418
490
|
}
|
|
419
491
|
handlePointerLeave(ev) {
|
|
420
492
|
// Route to external handler
|
|
@@ -423,6 +495,7 @@ export class EventRouter {
|
|
|
423
495
|
}
|
|
424
496
|
}
|
|
425
497
|
handleWheel(ev) {
|
|
498
|
+
this.syncModifiersFromPointer(ev);
|
|
426
499
|
if (this.wheelHandler) {
|
|
427
500
|
this.wheelHandler(ev);
|
|
428
501
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventRouter.js","sourceRoot":"","sources":["../../../../src/Utils/segmentation/eventRouter/EventRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH;;GAEG;AACH,MAAM,yBAAyB,GAAqB;IAChD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,GAAG;IACd,MAAM,EAAE,GAAG;IACX,UAAU,EAAE,aAAa;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,aAAa,GAAiB,IAAI,GAAG,CAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEpF;;;GAGG;AACH,MAAM,YAAY,GAAiB,IAAI,GAAG,CAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AAE/F,MAAM,OAAO,WAAW;IAkDpB,YAAY,MAAyB;QA7CrC,gBAAgB;QACR,SAAI,GAAoB,MAAM,CAAC;QACvC,kFAAkF;QAC1E,kBAAa,GAAoB,MAAM,CAAC;QACxC,YAAO,GAAY,QAAQ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C;IACL,CAAC;IAEO,WAAW,CAAC,EAAc;QAC9B,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC;IACL,CAAC;CACJ"}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -108993,6 +108993,11 @@ class DragOperator {
|
|
|
108993
108993
|
this.container.style.cursor = "";
|
|
108994
108994
|
this.container.removeEventListener("pointerdown", this.dragPrameters.handleOnDragMouseDown, true);
|
|
108995
108995
|
this.container.removeEventListener("pointerup", this.dragPrameters.handleOnDragMouseUp, true);
|
|
108996
|
+
// A drag already in flight keeps its pointermove binding, and pointerup —
|
|
108997
|
+
// the only thing that detaches it — has just been removed. Without this the
|
|
108998
|
+
// listener survives the button release and slices keep scrubbing on hover
|
|
108999
|
+
// until the next click happens to land while drag mode is configured again.
|
|
109000
|
+
this.container.removeEventListener("pointermove", this.dragPrameters.handleOnDragMouseMove, false);
|
|
108996
109001
|
this.setIsDrawFalse(1000);
|
|
108997
109002
|
};
|
|
108998
109003
|
this.container = container;
|
|
@@ -109429,6 +109434,7 @@ class EventRouter {
|
|
|
109429
109434
|
this.boundPointerLeave = this.handlePointerLeave.bind(this);
|
|
109430
109435
|
this.boundWheel = this.handleWheel.bind(this);
|
|
109431
109436
|
this.boundContextMenu = (e) => e.preventDefault();
|
|
109437
|
+
this.boundWindowBlur = this.handleWindowBlur.bind(this);
|
|
109432
109438
|
}
|
|
109433
109439
|
// ========================================
|
|
109434
109440
|
// Lifecycle Methods
|
|
@@ -109454,6 +109460,9 @@ class EventRouter {
|
|
|
109454
109460
|
this.canvas.addEventListener('wheel', this.boundWheel, { passive: false });
|
|
109455
109461
|
// Disable right-click context menu
|
|
109456
109462
|
this.canvas.addEventListener('contextmenu', this.boundContextMenu);
|
|
109463
|
+
// Alt-tabbing away swallows the keyup, so held modifiers would stay
|
|
109464
|
+
// latched until the key is pressed and released again.
|
|
109465
|
+
window.addEventListener('blur', this.boundWindowBlur);
|
|
109457
109466
|
this.isBound = true;
|
|
109458
109467
|
}
|
|
109459
109468
|
/**
|
|
@@ -109476,6 +109485,7 @@ class EventRouter {
|
|
|
109476
109485
|
this.canvas.removeEventListener('wheel', this.boundWheel);
|
|
109477
109486
|
// Context menu
|
|
109478
109487
|
this.canvas.removeEventListener('contextmenu', this.boundContextMenu);
|
|
109488
|
+
window.removeEventListener('blur', this.boundWindowBlur);
|
|
109479
109489
|
this.isBound = false;
|
|
109480
109490
|
}
|
|
109481
109491
|
// ========================================
|
|
@@ -109697,22 +109707,82 @@ class EventRouter {
|
|
|
109697
109707
|
// ========================================
|
|
109698
109708
|
// Internal Event Handlers
|
|
109699
109709
|
// ========================================
|
|
109710
|
+
/**
|
|
109711
|
+
* Apply the draw modifier going down. Shared by the keydown listener and
|
|
109712
|
+
* the pointer-event reconciliation below.
|
|
109713
|
+
*/
|
|
109714
|
+
applyDrawKeyDown() {
|
|
109715
|
+
this.state.shiftHeld = true;
|
|
109716
|
+
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
109717
|
+
// Also block when sphereBrush or sphereEraser is active
|
|
109718
|
+
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
109719
|
+
this.setMode('draw');
|
|
109720
|
+
}
|
|
109721
|
+
}
|
|
109722
|
+
/** Apply the draw modifier going up. */
|
|
109723
|
+
applyDrawKeyUp() {
|
|
109724
|
+
this.state.shiftHeld = false;
|
|
109725
|
+
if (this.mode === 'draw') {
|
|
109726
|
+
this.setMode('idle');
|
|
109727
|
+
}
|
|
109728
|
+
}
|
|
109729
|
+
/** Apply the contrast modifier going down. */
|
|
109730
|
+
applyContrastKeyDown() {
|
|
109731
|
+
if (!this.contrastEnabled)
|
|
109732
|
+
return;
|
|
109733
|
+
// Block contrast state when crosshair, draw, aiAssist, or any sphere-family tool is active (mutual exclusion)
|
|
109734
|
+
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
109735
|
+
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
109736
|
+
this.state.ctrlHeld = true;
|
|
109737
|
+
}
|
|
109738
|
+
}
|
|
109739
|
+
/**
|
|
109740
|
+
* Correct the tracked modifier state from a mouse/wheel event.
|
|
109741
|
+
*
|
|
109742
|
+
* Keyboard listeners are bound to the container, so they only fire while it
|
|
109743
|
+
* holds focus. Clicking a panel input moves focus away, and the container
|
|
109744
|
+
* then never sees the Shift keydown: `shiftHeld` stays false, the mode stays
|
|
109745
|
+
* `idle`, and the next left-drag scrubs slices instead of painting. Mouse
|
|
109746
|
+
* events carry the true OS modifier state on every dispatch no matter where
|
|
109747
|
+
* focus sits, which makes them the authoritative correction.
|
|
109748
|
+
*
|
|
109749
|
+
* Contrast is only ever cleared here, never toggled — the Ctrl toggle lives
|
|
109750
|
+
* on keyup in DrawToolCore, and driving it from pointer movement would flip
|
|
109751
|
+
* contrast on gestures the user never aimed at the canvas.
|
|
109752
|
+
*/
|
|
109753
|
+
syncModifiersFromPointer(ev) {
|
|
109754
|
+
if (ev.shiftKey !== this.state.shiftHeld) {
|
|
109755
|
+
if (ev.shiftKey) {
|
|
109756
|
+
this.applyDrawKeyDown();
|
|
109757
|
+
}
|
|
109758
|
+
else {
|
|
109759
|
+
this.applyDrawKeyUp();
|
|
109760
|
+
}
|
|
109761
|
+
}
|
|
109762
|
+
const ctrlDown = ev.ctrlKey || ev.metaKey;
|
|
109763
|
+
if (ctrlDown !== this.state.ctrlHeld) {
|
|
109764
|
+
if (ctrlDown) {
|
|
109765
|
+
this.applyContrastKeyDown();
|
|
109766
|
+
}
|
|
109767
|
+
else {
|
|
109768
|
+
this.state.ctrlHeld = false;
|
|
109769
|
+
}
|
|
109770
|
+
}
|
|
109771
|
+
}
|
|
109772
|
+
/** Drop latched modifiers when the window loses focus. */
|
|
109773
|
+
handleWindowBlur() {
|
|
109774
|
+
if (this.state.shiftHeld) {
|
|
109775
|
+
this.applyDrawKeyUp();
|
|
109776
|
+
}
|
|
109777
|
+
this.state.ctrlHeld = false;
|
|
109778
|
+
}
|
|
109700
109779
|
handleKeyDown(ev) {
|
|
109701
109780
|
// Update state based on modifier keys
|
|
109702
109781
|
if (ev.key === this.keyboardSettings.draw) {
|
|
109703
|
-
this.
|
|
109704
|
-
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
109705
|
-
// Also block when sphereBrush or sphereEraser is active
|
|
109706
|
-
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
109707
|
-
this.setMode('draw');
|
|
109708
|
-
}
|
|
109782
|
+
this.applyDrawKeyDown();
|
|
109709
109783
|
}
|
|
109710
109784
|
if (this.contrastEnabled && this.keyboardSettings.contrast.includes(ev.key)) {
|
|
109711
|
-
|
|
109712
|
-
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
109713
|
-
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
109714
|
-
this.state.ctrlHeld = true;
|
|
109715
|
-
}
|
|
109785
|
+
this.applyContrastKeyDown();
|
|
109716
109786
|
}
|
|
109717
109787
|
// Route to external handler
|
|
109718
109788
|
if (this.keydownHandler) {
|
|
@@ -109722,10 +109792,7 @@ class EventRouter {
|
|
|
109722
109792
|
handleKeyUp(ev) {
|
|
109723
109793
|
// Update state based on modifier keys
|
|
109724
109794
|
if (ev.key === this.keyboardSettings.draw) {
|
|
109725
|
-
this.
|
|
109726
|
-
if (this.mode === 'draw') {
|
|
109727
|
-
this.setMode('idle');
|
|
109728
|
-
}
|
|
109795
|
+
this.applyDrawKeyUp();
|
|
109729
109796
|
}
|
|
109730
109797
|
if (this.keyboardSettings.contrast.includes(ev.key)) {
|
|
109731
109798
|
this.state.ctrlHeld = false;
|
|
@@ -109741,6 +109808,9 @@ class EventRouter {
|
|
|
109741
109808
|
}
|
|
109742
109809
|
}
|
|
109743
109810
|
handlePointerDown(ev) {
|
|
109811
|
+
// Must run before the mode is read below: a Shift press the container
|
|
109812
|
+
// never received would otherwise leave this reading as a slice-drag.
|
|
109813
|
+
this.syncModifiersFromPointer(ev);
|
|
109744
109814
|
if (ev.button === 0) {
|
|
109745
109815
|
this.state.leftButtonDown = true;
|
|
109746
109816
|
}
|
|
@@ -109758,6 +109828,9 @@ class EventRouter {
|
|
|
109758
109828
|
}
|
|
109759
109829
|
}
|
|
109760
109830
|
handlePointerMove(ev) {
|
|
109831
|
+
// Hovering back over the canvas is the first chance to notice a Shift
|
|
109832
|
+
// that was pressed or released while focus sat in a panel field.
|
|
109833
|
+
this.syncModifiersFromPointer(ev);
|
|
109761
109834
|
// Route to external handler
|
|
109762
109835
|
if (this.pointerMoveHandler) {
|
|
109763
109836
|
this.pointerMoveHandler(ev);
|
|
@@ -109780,6 +109853,10 @@ class EventRouter {
|
|
|
109780
109853
|
if (this.pointerUpHandler) {
|
|
109781
109854
|
this.pointerUpHandler(ev);
|
|
109782
109855
|
}
|
|
109856
|
+
// Reconciled last on release so an in-progress stroke finalises under
|
|
109857
|
+
// the mode it started in, rather than being cut short by a Shift the
|
|
109858
|
+
// user let go of a moment before the button.
|
|
109859
|
+
this.syncModifiersFromPointer(ev);
|
|
109783
109860
|
}
|
|
109784
109861
|
handlePointerLeave(ev) {
|
|
109785
109862
|
// Route to external handler
|
|
@@ -109788,6 +109865,7 @@ class EventRouter {
|
|
|
109788
109865
|
}
|
|
109789
109866
|
}
|
|
109790
109867
|
handleWheel(ev) {
|
|
109868
|
+
this.syncModifiersFromPointer(ev);
|
|
109791
109869
|
if (this.wheelHandler) {
|
|
109792
109870
|
this.wheelHandler(ev);
|
|
109793
109871
|
}
|
|
@@ -117103,15 +117181,15 @@ function installFastSliceRepaint(rawSlice_1) {
|
|
|
117103
117181
|
}
|
|
117104
117182
|
|
|
117105
117183
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
117106
|
-
// "v3.9.
|
|
117184
|
+
// "v3.9.2" is injected at build time by rollup @rollup/plugin-replace, sourced from package.json version.
|
|
117107
117185
|
// When copper3d is consumed from local source (no rollup replace step), the identifier is undefined and
|
|
117108
117186
|
// referencing it throws a ReferenceError — guard it so local loading still works.
|
|
117109
117187
|
let _revision = "unknown";
|
|
117110
117188
|
try {
|
|
117111
|
-
_revision = "v3.9.
|
|
117189
|
+
_revision = "v3.9.2";
|
|
117112
117190
|
}
|
|
117113
117191
|
catch (_a) {
|
|
117114
|
-
/* "v3.9.
|
|
117192
|
+
/* "v3.9.2" not injected (local source build) */
|
|
117115
117193
|
}
|
|
117116
117194
|
const REVISION = _revision;
|
|
117117
117195
|
// Expose on global so the version can be read in a production browser console via window.__COPPER3D_VERSION__
|
package/dist/bundle.umd.js
CHANGED
|
@@ -109001,6 +109001,11 @@ void main() {
|
|
|
109001
109001
|
this.container.style.cursor = "";
|
|
109002
109002
|
this.container.removeEventListener("pointerdown", this.dragPrameters.handleOnDragMouseDown, true);
|
|
109003
109003
|
this.container.removeEventListener("pointerup", this.dragPrameters.handleOnDragMouseUp, true);
|
|
109004
|
+
// A drag already in flight keeps its pointermove binding, and pointerup —
|
|
109005
|
+
// the only thing that detaches it — has just been removed. Without this the
|
|
109006
|
+
// listener survives the button release and slices keep scrubbing on hover
|
|
109007
|
+
// until the next click happens to land while drag mode is configured again.
|
|
109008
|
+
this.container.removeEventListener("pointermove", this.dragPrameters.handleOnDragMouseMove, false);
|
|
109004
109009
|
this.setIsDrawFalse(1000);
|
|
109005
109010
|
};
|
|
109006
109011
|
this.container = container;
|
|
@@ -109437,6 +109442,7 @@ void main() {
|
|
|
109437
109442
|
this.boundPointerLeave = this.handlePointerLeave.bind(this);
|
|
109438
109443
|
this.boundWheel = this.handleWheel.bind(this);
|
|
109439
109444
|
this.boundContextMenu = (e) => e.preventDefault();
|
|
109445
|
+
this.boundWindowBlur = this.handleWindowBlur.bind(this);
|
|
109440
109446
|
}
|
|
109441
109447
|
// ========================================
|
|
109442
109448
|
// Lifecycle Methods
|
|
@@ -109462,6 +109468,9 @@ void main() {
|
|
|
109462
109468
|
this.canvas.addEventListener('wheel', this.boundWheel, { passive: false });
|
|
109463
109469
|
// Disable right-click context menu
|
|
109464
109470
|
this.canvas.addEventListener('contextmenu', this.boundContextMenu);
|
|
109471
|
+
// Alt-tabbing away swallows the keyup, so held modifiers would stay
|
|
109472
|
+
// latched until the key is pressed and released again.
|
|
109473
|
+
window.addEventListener('blur', this.boundWindowBlur);
|
|
109465
109474
|
this.isBound = true;
|
|
109466
109475
|
}
|
|
109467
109476
|
/**
|
|
@@ -109484,6 +109493,7 @@ void main() {
|
|
|
109484
109493
|
this.canvas.removeEventListener('wheel', this.boundWheel);
|
|
109485
109494
|
// Context menu
|
|
109486
109495
|
this.canvas.removeEventListener('contextmenu', this.boundContextMenu);
|
|
109496
|
+
window.removeEventListener('blur', this.boundWindowBlur);
|
|
109487
109497
|
this.isBound = false;
|
|
109488
109498
|
}
|
|
109489
109499
|
// ========================================
|
|
@@ -109705,22 +109715,82 @@ void main() {
|
|
|
109705
109715
|
// ========================================
|
|
109706
109716
|
// Internal Event Handlers
|
|
109707
109717
|
// ========================================
|
|
109718
|
+
/**
|
|
109719
|
+
* Apply the draw modifier going down. Shared by the keydown listener and
|
|
109720
|
+
* the pointer-event reconciliation below.
|
|
109721
|
+
*/
|
|
109722
|
+
applyDrawKeyDown() {
|
|
109723
|
+
this.state.shiftHeld = true;
|
|
109724
|
+
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
109725
|
+
// Also block when sphereBrush or sphereEraser is active
|
|
109726
|
+
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
109727
|
+
this.setMode('draw');
|
|
109728
|
+
}
|
|
109729
|
+
}
|
|
109730
|
+
/** Apply the draw modifier going up. */
|
|
109731
|
+
applyDrawKeyUp() {
|
|
109732
|
+
this.state.shiftHeld = false;
|
|
109733
|
+
if (this.mode === 'draw') {
|
|
109734
|
+
this.setMode('idle');
|
|
109735
|
+
}
|
|
109736
|
+
}
|
|
109737
|
+
/** Apply the contrast modifier going down. */
|
|
109738
|
+
applyContrastKeyDown() {
|
|
109739
|
+
if (!this.contrastEnabled)
|
|
109740
|
+
return;
|
|
109741
|
+
// Block contrast state when crosshair, draw, aiAssist, or any sphere-family tool is active (mutual exclusion)
|
|
109742
|
+
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
109743
|
+
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
109744
|
+
this.state.ctrlHeld = true;
|
|
109745
|
+
}
|
|
109746
|
+
}
|
|
109747
|
+
/**
|
|
109748
|
+
* Correct the tracked modifier state from a mouse/wheel event.
|
|
109749
|
+
*
|
|
109750
|
+
* Keyboard listeners are bound to the container, so they only fire while it
|
|
109751
|
+
* holds focus. Clicking a panel input moves focus away, and the container
|
|
109752
|
+
* then never sees the Shift keydown: `shiftHeld` stays false, the mode stays
|
|
109753
|
+
* `idle`, and the next left-drag scrubs slices instead of painting. Mouse
|
|
109754
|
+
* events carry the true OS modifier state on every dispatch no matter where
|
|
109755
|
+
* focus sits, which makes them the authoritative correction.
|
|
109756
|
+
*
|
|
109757
|
+
* Contrast is only ever cleared here, never toggled — the Ctrl toggle lives
|
|
109758
|
+
* on keyup in DrawToolCore, and driving it from pointer movement would flip
|
|
109759
|
+
* contrast on gestures the user never aimed at the canvas.
|
|
109760
|
+
*/
|
|
109761
|
+
syncModifiersFromPointer(ev) {
|
|
109762
|
+
if (ev.shiftKey !== this.state.shiftHeld) {
|
|
109763
|
+
if (ev.shiftKey) {
|
|
109764
|
+
this.applyDrawKeyDown();
|
|
109765
|
+
}
|
|
109766
|
+
else {
|
|
109767
|
+
this.applyDrawKeyUp();
|
|
109768
|
+
}
|
|
109769
|
+
}
|
|
109770
|
+
const ctrlDown = ev.ctrlKey || ev.metaKey;
|
|
109771
|
+
if (ctrlDown !== this.state.ctrlHeld) {
|
|
109772
|
+
if (ctrlDown) {
|
|
109773
|
+
this.applyContrastKeyDown();
|
|
109774
|
+
}
|
|
109775
|
+
else {
|
|
109776
|
+
this.state.ctrlHeld = false;
|
|
109777
|
+
}
|
|
109778
|
+
}
|
|
109779
|
+
}
|
|
109780
|
+
/** Drop latched modifiers when the window loses focus. */
|
|
109781
|
+
handleWindowBlur() {
|
|
109782
|
+
if (this.state.shiftHeld) {
|
|
109783
|
+
this.applyDrawKeyUp();
|
|
109784
|
+
}
|
|
109785
|
+
this.state.ctrlHeld = false;
|
|
109786
|
+
}
|
|
109708
109787
|
handleKeyDown(ev) {
|
|
109709
109788
|
// Update state based on modifier keys
|
|
109710
109789
|
if (ev.key === this.keyboardSettings.draw) {
|
|
109711
|
-
this.
|
|
109712
|
-
// Block draw mode when crosshair or contrast is active (mutual exclusion)
|
|
109713
|
-
// Also block when sphereBrush or sphereEraser is active
|
|
109714
|
-
if (DRAWING_TOOLS.has(this.guiTool) && !this.state.ctrlHeld && !this.state.crosshairEnabled) {
|
|
109715
|
-
this.setMode('draw');
|
|
109716
|
-
}
|
|
109790
|
+
this.applyDrawKeyDown();
|
|
109717
109791
|
}
|
|
109718
109792
|
if (this.contrastEnabled && this.keyboardSettings.contrast.includes(ev.key)) {
|
|
109719
|
-
|
|
109720
|
-
if (!this.state.crosshairEnabled && this.mode !== 'draw' && this.mode !== 'aiAssist'
|
|
109721
|
-
&& !SPHERE_TOOLS.has(this.guiTool)) {
|
|
109722
|
-
this.state.ctrlHeld = true;
|
|
109723
|
-
}
|
|
109793
|
+
this.applyContrastKeyDown();
|
|
109724
109794
|
}
|
|
109725
109795
|
// Route to external handler
|
|
109726
109796
|
if (this.keydownHandler) {
|
|
@@ -109730,10 +109800,7 @@ void main() {
|
|
|
109730
109800
|
handleKeyUp(ev) {
|
|
109731
109801
|
// Update state based on modifier keys
|
|
109732
109802
|
if (ev.key === this.keyboardSettings.draw) {
|
|
109733
|
-
this.
|
|
109734
|
-
if (this.mode === 'draw') {
|
|
109735
|
-
this.setMode('idle');
|
|
109736
|
-
}
|
|
109803
|
+
this.applyDrawKeyUp();
|
|
109737
109804
|
}
|
|
109738
109805
|
if (this.keyboardSettings.contrast.includes(ev.key)) {
|
|
109739
109806
|
this.state.ctrlHeld = false;
|
|
@@ -109749,6 +109816,9 @@ void main() {
|
|
|
109749
109816
|
}
|
|
109750
109817
|
}
|
|
109751
109818
|
handlePointerDown(ev) {
|
|
109819
|
+
// Must run before the mode is read below: a Shift press the container
|
|
109820
|
+
// never received would otherwise leave this reading as a slice-drag.
|
|
109821
|
+
this.syncModifiersFromPointer(ev);
|
|
109752
109822
|
if (ev.button === 0) {
|
|
109753
109823
|
this.state.leftButtonDown = true;
|
|
109754
109824
|
}
|
|
@@ -109766,6 +109836,9 @@ void main() {
|
|
|
109766
109836
|
}
|
|
109767
109837
|
}
|
|
109768
109838
|
handlePointerMove(ev) {
|
|
109839
|
+
// Hovering back over the canvas is the first chance to notice a Shift
|
|
109840
|
+
// that was pressed or released while focus sat in a panel field.
|
|
109841
|
+
this.syncModifiersFromPointer(ev);
|
|
109769
109842
|
// Route to external handler
|
|
109770
109843
|
if (this.pointerMoveHandler) {
|
|
109771
109844
|
this.pointerMoveHandler(ev);
|
|
@@ -109788,6 +109861,10 @@ void main() {
|
|
|
109788
109861
|
if (this.pointerUpHandler) {
|
|
109789
109862
|
this.pointerUpHandler(ev);
|
|
109790
109863
|
}
|
|
109864
|
+
// Reconciled last on release so an in-progress stroke finalises under
|
|
109865
|
+
// the mode it started in, rather than being cut short by a Shift the
|
|
109866
|
+
// user let go of a moment before the button.
|
|
109867
|
+
this.syncModifiersFromPointer(ev);
|
|
109791
109868
|
}
|
|
109792
109869
|
handlePointerLeave(ev) {
|
|
109793
109870
|
// Route to external handler
|
|
@@ -109796,6 +109873,7 @@ void main() {
|
|
|
109796
109873
|
}
|
|
109797
109874
|
}
|
|
109798
109875
|
handleWheel(ev) {
|
|
109876
|
+
this.syncModifiersFromPointer(ev);
|
|
109799
109877
|
if (this.wheelHandler) {
|
|
109800
109878
|
this.wheelHandler(ev);
|
|
109801
109879
|
}
|
|
@@ -117111,15 +117189,15 @@ void main() {
|
|
|
117111
117189
|
}
|
|
117112
117190
|
|
|
117113
117191
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
117114
|
-
// "v3.9.
|
|
117192
|
+
// "v3.9.2" is injected at build time by rollup @rollup/plugin-replace, sourced from package.json version.
|
|
117115
117193
|
// When copper3d is consumed from local source (no rollup replace step), the identifier is undefined and
|
|
117116
117194
|
// referencing it throws a ReferenceError — guard it so local loading still works.
|
|
117117
117195
|
let _revision = "unknown";
|
|
117118
117196
|
try {
|
|
117119
|
-
_revision = "v3.9.
|
|
117197
|
+
_revision = "v3.9.2";
|
|
117120
117198
|
}
|
|
117121
117199
|
catch (_a) {
|
|
117122
|
-
/* "v3.9.
|
|
117200
|
+
/* "v3.9.2" not injected (local source build) */
|
|
117123
117201
|
}
|
|
117124
117202
|
const REVISION = _revision;
|
|
117125
117203
|
// Expose on global so the version can be read in a production browser console via window.__COPPER3D_VERSION__
|
|
@@ -39,6 +39,7 @@ export declare class EventRouter {
|
|
|
39
39
|
private boundPointerLeave;
|
|
40
40
|
private boundWheel;
|
|
41
41
|
private boundContextMenu;
|
|
42
|
+
private boundWindowBlur;
|
|
42
43
|
private isBound;
|
|
43
44
|
constructor(config: EventRouterConfig);
|
|
44
45
|
/**
|
|
@@ -147,6 +148,32 @@ export declare class EventRouter {
|
|
|
147
148
|
* Register wheel handler.
|
|
148
149
|
*/
|
|
149
150
|
setWheelHandler(handler: WheelHandler): void;
|
|
151
|
+
/**
|
|
152
|
+
* Apply the draw modifier going down. Shared by the keydown listener and
|
|
153
|
+
* the pointer-event reconciliation below.
|
|
154
|
+
*/
|
|
155
|
+
private applyDrawKeyDown;
|
|
156
|
+
/** Apply the draw modifier going up. */
|
|
157
|
+
private applyDrawKeyUp;
|
|
158
|
+
/** Apply the contrast modifier going down. */
|
|
159
|
+
private applyContrastKeyDown;
|
|
160
|
+
/**
|
|
161
|
+
* Correct the tracked modifier state from a mouse/wheel event.
|
|
162
|
+
*
|
|
163
|
+
* Keyboard listeners are bound to the container, so they only fire while it
|
|
164
|
+
* holds focus. Clicking a panel input moves focus away, and the container
|
|
165
|
+
* then never sees the Shift keydown: `shiftHeld` stays false, the mode stays
|
|
166
|
+
* `idle`, and the next left-drag scrubs slices instead of painting. Mouse
|
|
167
|
+
* events carry the true OS modifier state on every dispatch no matter where
|
|
168
|
+
* focus sits, which makes them the authoritative correction.
|
|
169
|
+
*
|
|
170
|
+
* Contrast is only ever cleared here, never toggled — the Ctrl toggle lives
|
|
171
|
+
* on keyup in DrawToolCore, and driving it from pointer movement would flip
|
|
172
|
+
* contrast on gestures the user never aimed at the canvas.
|
|
173
|
+
*/
|
|
174
|
+
private syncModifiersFromPointer;
|
|
175
|
+
/** Drop latched modifiers when the window loses focus. */
|
|
176
|
+
private handleWindowBlur;
|
|
150
177
|
private handleKeyDown;
|
|
151
178
|
private handleKeyUp;
|
|
152
179
|
private handlePointerDown;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copper3d",
|
|
3
3
|
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
|
|
4
|
-
"version": "3.9.
|
|
4
|
+
"version": "3.9.2",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|