From f2fa41afc5f6b42223045e9c4eee6e6f57cadbc4 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:43:55 +1000 Subject: [PATCH] perf(ui): do not use stage.find --- .../web/src/features/controlLayers/konva/events.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/events.ts b/invokeai/frontend/web/src/features/controlLayers/konva/events.ts index 53fb797222..28a0af7801 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/events.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/events.ts @@ -8,7 +8,7 @@ import { clamp } from 'lodash-es'; import { v4 as uuidv4 } from 'uuid'; import { BRUSH_SPACING_TARGET_SCALE, CANVAS_SCALE_BY, MAX_CANVAS_SCALE, MIN_CANVAS_SCALE } from './constants'; -import { getBrushLineId, PREVIEW_TOOL_GROUP_ID } from './naming'; +import { getBrushLineId } from './naming'; /** * Updates the last cursor position atom with the current cursor position, returning the new position or `null` if the @@ -363,10 +363,6 @@ export const setStageEventHandlers = (manager: CanvasManager): (() => void) => { const selectedEntity = getSelectedEntity(); const selectedEntityAdapter = getSelectedEntityAdapter(); - stage - .findOne(`#${PREVIEW_TOOL_GROUP_ID}`) - ?.visible(toolState.selected === 'brush' || toolState.selected === 'eraser'); - if ( pos && selectedEntity && @@ -500,8 +496,6 @@ export const setStageEventHandlers = (manager: CanvasManager): (() => void) => { const selectedEntity = getSelectedEntity(); const toolState = getToolState(); - stage.findOne(`#${PREVIEW_TOOL_GROUP_ID}`)?.visible(false); - if (pos && selectedEntity && isDrawableEntity(selectedEntity) && !getSpaceKey() && getIsMouseDown()) { if (getIsMouseDown()) { if (toolState.selected === 'brush') {