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 _ from 'lodash';
import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import IAICanvasStatusTextCursorPos from './IAICanvasStatusText/IAICanvasStatusTextCursorPos'; import IAICanvasStatusTextCursorPos from './IAICanvasStatusText/IAICanvasStatusTextCursorPos';
import roundToHundreth from '../util/roundToHundreth';
const roundToHundreth = (val: number): number => {
return Math.round(val * 100) / 100;
};
const selector = createSelector( const selector = createSelector(
[canvasSelector], [canvasSelector],

View File

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