Revision: 5064
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5064&view=rev
Author: mdboom
Date: 2008-04-23 05:37:58 -0700 (Wed, 23 Apr 2008)
Log Message:
-----------
Use our own "round" function, since it doesn't appear to exist in VS2003
Modified Paths:
--------------
trunk/matplotlib/src/agg_py_path_iterator.h
Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-04-23 07:21:03 UTC (rev
5063)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-04-23 12:37:58 UTC (rev
5064)
@@ -8,6 +8,10 @@
#include "MPL_isnan.h"
#include <queue>
+static inline double my_round(double v) {
+ return (double)(int)(v + ((v >= 0.0) ? 0.5 : -0.5));
+}
+
class PathIterator
{
PyArrayObject* m_vertices;
@@ -157,8 +161,8 @@
cmd = m_source->vertex(x, y);
if (m_quantize && agg::is_vertex(cmd))
{
- *x = round(*x) + 0.5;
- *y = round(*y) + 0.5;
+ *x = my_round(*x) + 0.5;
+ *y = my_round(*y) + 0.5;
}
return cmd;
}
@@ -214,8 +218,8 @@
// Do any quantization if requested
if (m_quantize && agg::is_vertex(cmd))
{
- *x = round(*x) + 0.5;
- *y = round(*y) + 0.5;
+ *x = my_round(*x) + 0.5;
+ *y = my_round(*y) + 0.5;
}
//if we are starting a new path segment, move to the first point
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins