Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c76736

Browse files
committed
Fix problem with NaNs at end of path.
svn path=/trunk/matplotlib/; revision=5775
1 parent d5c7c1f commit 0c76736

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for
2+
the report) - MGD
3+
14
2008-07-12 Added support for external backends with the
25
"module://my_backend" syntax - JDH
36

src/agg_py_path_iterator.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ class PathIterator
7575
{
7676
if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
7777
unsigned code = vertex_with_code(m_iterator++, x, y);
78-
while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
79-
m_iterator < m_total_vertices)
80-
{
78+
if (MPL_isnan64(*x) || MPL_isnan64(*y)) {
79+
do {
8180
vertex(m_iterator++, x, y);
82-
code = agg::path_cmd_move_to;
81+
} while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
82+
m_iterator < m_total_vertices);
83+
return (m_iterator >= m_total_vertices) ? agg::path_cmd_stop :
84+
agg::path_cmd_move_to;
8385
}
8486
return code;
8587
}

0 commit comments

Comments
 (0)