diff options
author | Johan Paulsson <gonz@Akita.local> | 2014-02-14 17:53:26 +0000 |
---|---|---|
committer | Johan Paulsson <gonz@Akita.local> | 2014-02-14 17:53:26 +0000 |
commit | 5506611ee009498f1f9bce89b6e6735b19d6b137 (patch) | |
tree | 84ed58389c0131c67bd2bb33eb6b04ffaba5b6c6 /tikzit/src | |
parent | bac3d27d19167d398cf9bcd1c6c282ad7a3199fe (diff) |
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.
Diffstat (limited to 'tikzit/src')
-rw-r--r-- | tikzit/src/osx/GraphicsView.m | 4 |
1 files changed, 2 insertions, 2 deletions
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); |