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 {
289289 this . manager . stage . setCursor ( 'none' ) ;
290290 } ;
291291
292+ getCanPick = ( ) => {
293+ if ( this . manager . stage . getIsDragging ( ) ) {
294+ return false ;
295+ }
296+
297+ return true ;
298+ } ;
299+
292300 /**
293301 * Renders the color picker tool preview on the canvas.
294302 */
@@ -298,6 +306,11 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
298306 return ;
299307 }
300308
309+ if ( ! this . getCanPick ( ) ) {
310+ this . setVisibility ( false ) ;
311+ return ;
312+ }
313+
301314 const cursorPos = this . parent . $cursorPos . get ( ) ;
302315
303316 if ( ! cursorPos ) {
@@ -406,11 +419,21 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
406419 } ;
407420
408421 onStagePointerUp = ( _e : KonvaEventObject < PointerEvent > ) => {
422+ if ( ! this . getCanPick ( ) ) {
423+ this . setVisibility ( false ) ;
424+ return ;
425+ }
426+
409427 const { a : _ , ...color } = this . $colorUnderCursor . get ( ) ;
410428 this . manager . stateApi . setColor ( color ) ;
411429 } ;
412430
413431 onStagePointerMove = ( _e : KonvaEventObject < PointerEvent > ) => {
432+ if ( ! this . getCanPick ( ) ) {
433+ this . setVisibility ( false ) ;
434+ return ;
435+ }
436+
414437 this . syncColorUnderCursor ( ) ;
415438 } ;
416439
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export class CanvasToolModule extends CanvasModuleBase {
164164 const selectedEntityAdapter = this . manager . stateApi . getSelectedEntityAdapter ( ) ;
165165
166166 if ( this . manager . stage . getIsDragging ( ) ) {
167- this . tools . view . syncCursorStyle ( ) ;
167+ stage . setCursor ( 'grabbing' ) ;
168168 } else if ( tool === 'view' ) {
169169 this . tools . view . syncCursorStyle ( ) ;
170170 } else if ( segmentingAdapter ) {
You can’t perform that action at this time.
0 commit comments