protected getIntersection(
node: INode,
inner: Point,
outer: Point
): Point | null {
const layout = node.layout.toRect()
const emptyRect = new Rect(
layout.x + tabWidth,
layout.y,
layout.width - tabWidth,
tabHeight
)
if (emptyRect.intersectsLine(inner, outer)) {
const segment1: [Point, Point] = [
new Point(layout.x + tabWidth, layout.y),
new Point(layout.x + tabWidth, layout.y + tabHeight)
]
const segment2: [Point, Point] = [
new Point(layout.x + tabWidth, layout.y + tabHeight),
new Point(layout.maxX, layout.y + tabHeight)
]
const intersection1 = findLineIntersection(segment1, [inner, outer])
const intersection2 = findLineIntersection(segment2, [inner, outer])
if (intersection1 === null || intersection2 === null) {
return intersection1 ?? intersection2
}
}
return layout.findLineIntersection(inner, outer)
}