From 5506611ee009498f1f9bce89b6e6735b19d6b137 Mon Sep 17 00:00:00 2001 From: Johan Paulsson Date: Fri, 14 Feb 2014 17:53:26 +0000 Subject: Fix for crash when moving too close to each other Dividing by wrong variable causes the program to crash when moving nodes too close to each. --- tikzit/src/osx/GraphicsView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tikzit/src/osx/GraphicsView.m') diff --git a/tikzit/src/osx/GraphicsView.m b/tikzit/src/osx/GraphicsView.m index 49b1af6..efa7ecb 100644 --- a/tikzit/src/osx/GraphicsView.m +++ b/tikzit/src/osx/GraphicsView.m @@ -829,8 +829,8 @@ static CGColorRef cgGrayColor, cgWhiteColor, cgClearColor = nil; float tdx = cp2.x - targ.x; float tdy = cp2.y - targ.y; float tdist = sqrt(tdx*tdx + tdy*tdy); - float tshortx = (tdist==0) ? 0 : tdx/sdist * tradius; - float tshorty = (tdist==0) ? 0 : tdy/sdist * tradius; + float tshortx = (tdist==0) ? 0 : tdx/tdist * tradius; + float tshorty = (tdist==0) ? 0 : tdy/tdist * tradius; CGContextMoveToPoint(context, src.x+sshortx, src.y+sshorty); CGContextAddCurveToPoint(context, cp1.x, cp1.y, cp2.x, cp2.y, targ.x+tshortx, targ.y+tshorty); -- cgit v1.2.3