From eecfddc55b4080fe508194a838a5f49ce8a50512 Mon Sep 17 00:00:00 2001 From: moklick Date: Sat, 18 Dec 2021 14:39:01 +0100 Subject: [PATCH] fix(selection): use correct x y for selection rect on direction change closes #1772 --- src/store/reducer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/reducer.ts b/src/store/reducer.ts index d9b9fbb4..617fda63 100644 --- a/src/store/reducer.ts +++ b/src/store/reducer.ts @@ -185,8 +185,8 @@ export default function reactFlowReducer(state = initialState, action: ReactFlow const nextUserSelectRect = { ...state.userSelectionRect, - x: mousePos.x < startX ? mousePos.x : state.userSelectionRect.x, - y: mousePos.y < startY ? mousePos.y : state.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), };