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

Skip to content

Commit 2c28ad2

Browse files
committed
Fix bug where a line with NULL data limits prevents subsequent data limits from calculating correctly
svn path=/branches/v0_98_5_maint/; revision=6661
1 parent a375c3b commit 2c28ad2

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
2008-12-18 Fix bug where a line with NULL data limits prevents
2+
subsequent data limits from calculating correctly - MGD
3+
4+
2008-12-17 Major documentation generator changes - MGD
5+
16
2008-12-17 Applied macosx backend patch with support for path
27
collections, quadmesh, etc... - JDH
38

49
2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
510
-JJL
11+
612
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
713

814
======================================================================

src/_path.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,25 @@ Py::Object _path_module::update_path_extents(const Py::Tuple& args)
403403
}
404404
else
405405
{
406-
extents_data[0] = std::min(x0, x1);
407-
extents_data[1] = std::min(y0, y1);
408-
extents_data[2] = std::max(x0, x1);
409-
extents_data[3] = std::max(y0, y1);
406+
if (x0 > x1)
407+
{
408+
extents_data[0] = std::numeric_limits<double>::infinity();
409+
extents_data[2] = -std::numeric_limits<double>::infinity();
410+
}
411+
else
412+
{
413+
extents_data[0] = x0;
414+
extents_data[2] = x1;
415+
}
416+
if (y0 > y1) {
417+
extents_data[1] = std::numeric_limits<double>::infinity();
418+
extents_data[3] = -std::numeric_limits<double>::infinity();
419+
}
420+
else
421+
{
422+
extents_data[1] = y0;
423+
extents_data[3] = y1;
424+
}
410425
minpos_data[0] = xm;
411426
minpos_data[1] = ym;
412427
}

0 commit comments

Comments
 (0)