diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2013-03-22 18:55:32 +0000 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2013-03-22 18:55:32 +0000 |
commit | 515f5473f64b16128fed09eaecce734ffcb50ade (patch) | |
tree | 49fb74f100f142e68039c6ee1eb327c5f77c5f3b /tikzit/src/common/Edge.m | |
parent | 857b2eacbad89daeb1e7dd751ca97ff6ea56a634 (diff) |
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.
Diffstat (limited to 'tikzit/src/common/Edge.m')
-rw-r--r-- | tikzit/src/common/Edge.m | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |