|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49358 - trunk/boost/graph
From: aaron.windsor_at_[hidden]
Date: 2008-10-16 08:02:38
Author: aaron_windsor
Date: 2008-10-16 08:02:37 EDT (Thu, 16 Oct 2008)
New Revision: 49358
URL: http://svn.boost.org/trac/boost/changeset/49358
Log:
Patch from David Gleich to fix underflow and overflow that can happen when computing vertex positions in chroback_payne_straight_line_drawing
Text files modified:
trunk/boost/graph/chrobak_payne_drawing.hpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Modified: trunk/boost/graph/chrobak_payne_drawing.hpp
==============================================================================
--- trunk/boost/graph/chrobak_payne_drawing.hpp (original)
+++ trunk/boost/graph/chrobak_payne_drawing.hpp 2008-10-16 08:02:37 EDT (Thu, 16 Oct 2008)
@@ -193,8 +193,8 @@
delta_p_q += delta_x[temp];
}
- delta_x[v] = (y[rightmost] - y[leftmost] + delta_p_q)/2;
- y[v] = (y[rightmost] + y[leftmost] + delta_p_q)/2;
+ delta_x[v] = ((y[rightmost] + delta_p_q) - y[leftmost])/2;
+ y[v] = y[leftmost] + delta_x[v];
delta_x[rightmost] = delta_p_q - delta_x[v];
bool leftmost_and_rightmost_adjacent = right[leftmost] == rightmost;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk