[mapserver-commits] r11519 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Mon Apr 11 06:29:22 EDT 2011
Author: tbonfort
Date: 2011-04-11 03:29:22 -0700 (Mon, 11 Apr 2011)
New Revision: 11519
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapchart.c
Log:
fix division by 0 error in bar charts for some ill-defined cases (#3218)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-04-11 10:13:22 UTC (rev 11518)
+++ trunk/mapserver/HISTORY.TXT 2011-04-11 10:29:22 UTC (rev 11519)
@@ -15,6 +15,8 @@
Current Version (SVN trunk):
----------------------------
+- fix division by 0 error in bar charts for some ill-defined cases (#3218)
+
- add GAP, POSITION and CAPS/JOINS to mapfile writer (#3797)
- fix GEOMTRANSFORM rotation orientation for vector symbols (#3802)
Modified: trunk/mapserver/mapchart.c
===================================================================
--- trunk/mapserver/mapchart.c 2011-04-11 10:13:22 UTC (rev 11518)
+++ trunk/mapserver/mapchart.c 2011-04-11 10:29:22 UTC (rev 11519)
@@ -184,6 +184,11 @@
*/
upperLimit = (maxVal!=NULL)? *maxVal : MS_MAX(shapeMaxVal,0);
lowerLimit = (minVal!=NULL)? *minVal : MS_MIN(shapeMinVal,0);
+ if(upperLimit==lowerLimit) {
+ /* treat the case where we would have an unspecified behavior */
+ upperLimit+=0.5;
+ lowerLimit-=0.5;
+ }
pixperval=(float)height/(upperLimit-lowerLimit);
vertOrigin=bottom+lowerLimit*pixperval;
More information about the mapserver-commits
mailing list