diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 69eb955c..6030f43f 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -1820,7 +1820,13 @@ export function useMode() { x: xDiff.eq(0) ? offsetCurrentPoint.x : nextWall.x1, y: yDiff.eq(0) ? offsetCurrentPoint.y : nextWall.y1, } - const diffOffset = Big(nextWall.attributes.offset).minus(Big(currentWall.attributes.offset)) + let diffOffset + if (nextWall.index > currentWall.index) { + diffOffset = Big(nextWall.attributes.offset).minus(Big(currentWall.attributes.offset)).abs() + } else { + diffOffset = Big(currentWall.attributes.offset).minus(Big(nextWall.attributes.offset)) + } + const offsetPoint2 = { x: yDiff.eq(0) ? offsetPoint1.x : Big(offsetPoint1.x).plus(diffOffset).toNumber(), y: xDiff.eq(0) ? offsetPoint1.y : Big(offsetPoint1.y).plus(diffOffset).toNumber(),