2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-01 08:32:11 +00:00

Patch from David Gleich to fix underflow and overflow that can happen when computing vertex positions in chroback_payne_straight_line_drawing

[SVN r49358]
This commit is contained in:
Aaron Windsor
2008-10-16 12:02:37 +00:00
parent 71f20dd7b6
commit ebde55caab

View File

@@ -193,8 +193,8 @@ namespace boost
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;