Fixed issue with intersection calculations for linedCylinder

This commit is contained in:
Knut Sveidqvist 2024-09-04 14:12:41 +02:00
parent 69bec16080
commit 5d3a175ed6

View File

@ -97,7 +97,7 @@ export const linedCylinder = async (parent: SVGAElement, node: Node) => {
Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry))
) {
let y = ry * ry * (1 - (x * x) / (rx * rx));
if (y != 0) {
if (y > 0) {
y = Math.sqrt(y);
}
y = ry - y;