File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,14 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
289
289
this . manager . stage . setCursor ( 'none' ) ;
290
290
} ;
291
291
292
+ getCanPick = ( ) => {
293
+ if ( this . manager . stage . getIsDragging ( ) ) {
294
+ return false ;
295
+ }
296
+
297
+ return true ;
298
+ } ;
299
+
292
300
/**
293
301
* Renders the color picker tool preview on the canvas.
294
302
*/
@@ -298,6 +306,11 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
298
306
return ;
299
307
}
300
308
309
+ if ( ! this . getCanPick ( ) ) {
310
+ this . setVisibility ( false ) ;
311
+ return ;
312
+ }
313
+
301
314
const cursorPos = this . parent . $cursorPos . get ( ) ;
302
315
303
316
if ( ! cursorPos ) {
@@ -406,11 +419,21 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
406
419
} ;
407
420
408
421
onStagePointerUp = ( _e : KonvaEventObject < PointerEvent > ) => {
422
+ if ( ! this . getCanPick ( ) ) {
423
+ this . setVisibility ( false ) ;
424
+ return ;
425
+ }
426
+
409
427
const { a : _ , ...color } = this . $colorUnderCursor . get ( ) ;
410
428
this . manager . stateApi . setColor ( color ) ;
411
429
} ;
412
430
413
431
onStagePointerMove = ( _e : KonvaEventObject < PointerEvent > ) => {
432
+ if ( ! this . getCanPick ( ) ) {
433
+ this . setVisibility ( false ) ;
434
+ return ;
435
+ }
436
+
414
437
this . syncColorUnderCursor ( ) ;
415
438
} ;
416
439
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export class CanvasToolModule extends CanvasModuleBase {
164
164
const selectedEntityAdapter = this . manager . stateApi . getSelectedEntityAdapter ( ) ;
165
165
166
166
if ( this . manager . stage . getIsDragging ( ) ) {
167
- this . tools . view . syncCursorStyle ( ) ;
167
+ stage . setCursor ( 'grabbing' ) ;
168
168
} else if ( tool === 'view' ) {
169
169
this . tools . view . syncCursorStyle ( ) ;
170
170
} else if ( segmentingAdapter ) {
You can’t perform that action at this time.
0 commit comments