mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Un-floors cursor position
This commit is contained in:
parent
7515bcfe78
commit
6f3e99efc3
@ -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],
|
||||||
|
@ -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,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user