From 515f5473f64b16128fed09eaecce734ffcb50ade Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 22 Mar 2013 18:55:32 +0000 Subject: Account for rounding errors when calculating edge head and tail Previously, we could find the "maximum exit point" of an edge to be very slightly inside the actual bounds; this would cause the actual exit point not to be found. So we expand the bounding rect very slightly. --- tikzit/src/common/Edge.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tikzit/src/common/Edge.m b/tikzit/src/common/Edge.m index e90806d..aa8a3ac 100644 --- a/tikzit/src/common/Edge.m +++ b/tikzit/src/common/Edge.m @@ -83,7 +83,8 @@ } Transformer *shapeTrans = [node shapeTransformer]; - NSRect searchArea = [node boundsUsingShapeTransform:shapeTrans]; + // rounding errors are a pain + NSRect searchArea = NSInsetRect([node boundsUsingShapeTransform:shapeTrans],-0.01,-0.01); if (!NSPointInRect(rayStart, searchArea)) { return rayStart; } -- cgit v1.2.3