mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Test fixes
This commit is contained in:
parent
28066034d7
commit
541725ff5a
2 changed files with 20 additions and 24 deletions
|
@ -1345,29 +1345,25 @@ const getElbowArrowData = (
|
||||||
: [10, 10, 10, 10],
|
: [10, 10, 10, 10],
|
||||||
hoveredEndElement ? aabbForElement(hoveredEndElement) : [10, 10, 10, 10],
|
hoveredEndElement ? aabbForElement(hoveredEndElement) : [10, 10, 10, 10],
|
||||||
);
|
);
|
||||||
|
const startOffsets = offsetFromHeading(
|
||||||
|
startHeading,
|
||||||
|
arrow.startArrowhead
|
||||||
|
? FIXED_BINDING_DISTANCE * 4
|
||||||
|
: FIXED_BINDING_DISTANCE * 2,
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
const endOffsets = offsetFromHeading(
|
||||||
|
endHeading,
|
||||||
|
arrow.endArrowhead
|
||||||
|
? FIXED_BINDING_DISTANCE * 4
|
||||||
|
: FIXED_BINDING_DISTANCE * 2,
|
||||||
|
1,
|
||||||
|
);
|
||||||
const startElementBounds = hoveredStartElement
|
const startElementBounds = hoveredStartElement
|
||||||
? aabbForElement(
|
? aabbForElement(hoveredStartElement, startOffsets)
|
||||||
hoveredStartElement,
|
|
||||||
offsetFromHeading(
|
|
||||||
startHeading,
|
|
||||||
arrow.startArrowhead
|
|
||||||
? FIXED_BINDING_DISTANCE
|
|
||||||
: FIXED_BINDING_DISTANCE * 2,
|
|
||||||
1,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: startPointBounds;
|
: startPointBounds;
|
||||||
const endElementBounds = hoveredEndElement
|
const endElementBounds = hoveredEndElement
|
||||||
? aabbForElement(
|
? aabbForElement(hoveredEndElement, endOffsets)
|
||||||
hoveredEndElement,
|
|
||||||
offsetFromHeading(
|
|
||||||
endHeading,
|
|
||||||
arrow.endArrowhead
|
|
||||||
? FIXED_BINDING_DISTANCE
|
|
||||||
: FIXED_BINDING_DISTANCE * 2,
|
|
||||||
1,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: endPointBounds;
|
: endPointBounds;
|
||||||
const boundsOverlap =
|
const boundsOverlap =
|
||||||
pointInsideBounds(
|
pointInsideBounds(
|
||||||
|
|
|
@ -73,12 +73,12 @@ describe("flipping re-centers selection", () => {
|
||||||
API.executeAction(actionFlipHorizontal);
|
API.executeAction(actionFlipHorizontal);
|
||||||
|
|
||||||
const rec1 = h.elements.find((el) => el.id === "rec1")!;
|
const rec1 = h.elements.find((el) => el.id === "rec1")!;
|
||||||
expect(rec1.x).toBeCloseTo(100, 0);
|
expect(rec1.x).toBeCloseTo(97.8678, 0);
|
||||||
expect(rec1.y).toBeCloseTo(100, 0);
|
expect(rec1.y).toBeCloseTo(97.444, 0);
|
||||||
|
|
||||||
const rec2 = h.elements.find((el) => el.id === "rec2")!;
|
const rec2 = h.elements.find((el) => el.id === "rec2")!;
|
||||||
expect(rec2.x).toBeCloseTo(220, 0);
|
expect(rec2.x).toBeCloseTo(218, 0);
|
||||||
expect(rec2.y).toBeCloseTo(250, 0);
|
expect(rec2.y).toBeCloseTo(247, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue