Un-floors cursor position

This commit is contained in:
psychedelicious 2022-11-24 08:04:53 +11:00 committed by blessedcoolant
parent 7515bcfe78
commit 6f3e99efc3
2 changed files with 3 additions and 6 deletions

View File

@ -3,10 +3,7 @@ import { useAppSelector } from 'app/store';
import _ from 'lodash';
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import IAICanvasStatusTextCursorPos from './IAICanvasStatusText/IAICanvasStatusTextCursorPos';
const roundToHundreth = (val: number): number => {
return Math.round(val * 100) / 100;
};
import roundToHundreth from '../util/roundToHundreth';
const selector = createSelector(
[canvasSelector],

View File

@ -10,8 +10,8 @@ const getScaledCursorPosition = (stage: Stage) => {
const scaledCursorPosition = stageTransform.invert().point(pointerPosition);
return {
x: Math.floor(scaledCursorPosition.x),
y: Math.floor(scaledCursorPosition.y),
x: scaledCursorPosition.x,
y: scaledCursorPosition.y,
};
};