From c0c32d9daaaba7246441bc53419266da69256564 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 30 Oct 2022 18:06:07 +1100 Subject: [PATCH] Fixes bug with bounding box transforming cursor --- .../components/InpaintingBoundingBoxPreview.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx b/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx index 2525b8984c..610dddb42a 100644 --- a/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx +++ b/frontend/src/features/tabs/Inpainting/components/InpaintingBoundingBoxPreview.tsx @@ -12,6 +12,7 @@ import { useAppSelector, } from '../../../../app/store'; import { roundToMultiple } from '../../../../common/util/roundDownToMultiple'; +import { stageRef } from '../InpaintingCanvas'; import { InpaintingState, setBoundingBoxCoordinate, @@ -107,6 +108,15 @@ const InpaintingBoundingBoxPreview = () => { transformerRef.current.getLayer()?.batchDraw(); }, [shouldLockBoundingBox]); + useEffect( + () => () => { + const container = stageRef.current?.container(); + if (!container) return; + container.style.cursor = 'none'; + }, + [shouldLockBoundingBox] + ); + const scaledStep = 64 * stageScale; const handleOnDragMove = useCallback(