fix selection box when not grid-aligned

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-12-07 18:25:59 -03:00
parent 3c0eed68ce
commit 3373d2964e

View file

@ -101,6 +101,10 @@ const selectTransformTool = () =>
// Selection bounding box object. Has some witchery to deal with handles.
const selectionBB = (x1, y1, x2, y2) => {
x1 = Math.round(x1);
y1 = Math.round(y1);
x2 = Math.round(x2);
y2 = Math.round(y2);
return {
original: {
x: Math.min(x1, x2),