Fixes bug with bounding box transforming cursor

This commit is contained in:
psychedelicious 2022-10-30 18:06:07 +11:00
parent 52e74fef7c
commit c0c32d9daa

View File

@ -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(