[Cleanup] Removes unused code (#996)

- Removes unused code
- Removes unnecessary globalAlpha reset when drawing reroute highlight
This commit is contained in:
filtered
2025-05-02 08:38:54 +10:00
committed by GitHub
parent cb6020dfc1
commit ee89fc575f
6 changed files with 4 additions and 48 deletions

View File

@@ -15,7 +15,6 @@ import {
isInRectangle,
isInsideRectangle,
isPointInRect,
isSortaInsideOctagon,
overlapBounding,
rotateLink,
snapPoint,
@@ -154,25 +153,6 @@ test("isInsideRectangle handles edge cases differently from isInRectangle", ({ e
expect(isInsideRectangle(11, 5, 0, 0, 10, 10)).toBe(false)
})
test("isSortaInsideOctagon approximates octagon containment", ({ expect }) => {
const radius = 10
// Points clearly inside
expect(isSortaInsideOctagon(0, 0, radius)).toBe(true)
expect(isSortaInsideOctagon(3, 3, radius)).toBe(true)
// Points on diagonal (roughly on octagon edge)
expect(isSortaInsideOctagon(7, 7, radius)).toBe(false)
// Points clearly outside
expect(isSortaInsideOctagon(10, 10, radius)).toBe(false)
expect(isSortaInsideOctagon(-10, -10, radius)).toBe(false)
// Points on axes
expect(isSortaInsideOctagon(radius * 0.5, 0, radius)).toBe(true)
expect(isSortaInsideOctagon(0, radius * 0.5, radius)).toBe(true)
})
test("containsRect correctly identifies nested rectangles", ({ expect }) => {
const container: Rect = [0, 0, 20, 20]