fix(selection): use start x and y when direction changes

This commit is contained in:
moklick
2021-12-18 14:28:01 +01:00
parent 0e3ddc2741
commit 6bbd06a16e
+2 -2
View File
@@ -91,8 +91,8 @@ export default memo(({ selectionKeyPressed }: UserSelectionProps) => {
const nextUserSelectRect = {
...userSelectionRect,
x: mousePos.x < startX ? mousePos.x : userSelectionRect.x,
y: mousePos.y < startY ? mousePos.y : userSelectionRect.y,
x: mousePos.x < startX ? mousePos.x : startX,
y: mousePos.y < startY ? mousePos.y : startY,
width: Math.abs(mousePos.x - startX),
height: Math.abs(mousePos.y - startY),
};