Further fine-tune adaptive padding
This commit is contained in:
parent
eaa869620e
commit
c06b78c1b2
@ -117,8 +117,8 @@ const calculatePadding = (
|
|||||||
const width = aabb[2] - aabb[0];
|
const width = aabb[2] - aabb[0];
|
||||||
const height = aabb[3] - aabb[1];
|
const height = aabb[3] - aabb[1];
|
||||||
const size = Math.max(width, height);
|
const size = Math.max(width, height);
|
||||||
// || compareHeading(startHeading, flipHeading(endHeading))
|
|
||||||
return size > 55
|
return size > 75
|
||||||
? 40
|
? 40
|
||||||
: Math.min(
|
: Math.min(
|
||||||
Math.max(
|
Math.max(
|
||||||
|
@ -294,11 +294,11 @@ describe("elbow arrow ui", () => {
|
|||||||
) as HTMLInputElement;
|
) as HTMLInputElement;
|
||||||
UI.updateInput(inputAngle, String("40"));
|
UI.updateInput(inputAngle, String("40"));
|
||||||
|
|
||||||
expect(arrow.points.map((point) => point.map(Math.round))).toEqual([
|
expect(arrow.points).toCloselyEqualPoints([
|
||||||
[0, 0],
|
[0, 0],
|
||||||
[34, 0],
|
[34.9292, 0],
|
||||||
[34, 165],
|
[34.48768, 164.6246],
|
||||||
[104, 165],
|
[104.333, 164.6246],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user