Fixes stage position changing on zoom

This commit is contained in:
psychedelicious 2022-11-19 20:12:26 +11:00 committed by blessedcoolant
parent 917c576ddb
commit e7f670a5b6
2 changed files with 4 additions and 2 deletions

View File

@ -88,7 +88,9 @@ const IAICanvasStatusText = () => {
boxX boxX
)}, ${roundToHundreth(boxY)})`}</div> )}, ${roundToHundreth(boxY)})`}</div>
<div>{`Canvas Dimensions: ${stageWidth}×${stageHeight}`}</div> <div>{`Canvas Dimensions: ${stageWidth}×${stageHeight}`}</div>
<div>{`Canvas Position: ${stageX}×${stageY}`}</div> <div>{`Canvas Position: ${roundToHundreth(stageX)}×${roundToHundreth(
stageY
)}`}</div>
<div>{`Cursor Position: (${cursorX}, ${cursorY})`}</div> <div>{`Cursor Position: (${cursorX}, ${cursorY})`}</div>
</> </>
)} )}

View File

@ -244,7 +244,7 @@ export const canvasSlice = createSlice({
state.boundingBoxCoordinates = floorCoordinates(action.payload); state.boundingBoxCoordinates = floorCoordinates(action.payload);
}, },
setStageCoordinates: (state, action: PayloadAction<Vector2d>) => { setStageCoordinates: (state, action: PayloadAction<Vector2d>) => {
state.stageCoordinates = floorCoordinates(action.payload); state.stageCoordinates = action.payload;
}, },
setBoundingBoxPreviewFill: (state, action: PayloadAction<RgbaColor>) => { setBoundingBoxPreviewFill: (state, action: PayloadAction<RgbaColor>) => {
state.boundingBoxPreviewFill = action.payload; state.boundingBoxPreviewFill = action.payload;