[mapserver-commits] r10326 - sandbox/mapserver6

svn at osgeo.org svn at osgeo.org
Fri Jul 9 05:34:26 EDT 2010


Author: tbonfort
Date: 2010-07-09 09:34:26 +0000 (Fri, 09 Jul 2010)
New Revision: 10326

Modified:
   sandbox/mapserver6/maplegend.c
   sandbox/mapserver6/mapscale.c
Log:
force boundaries on center of pixels to avoid aliasing effects


Modified: sandbox/mapserver6/maplegend.c
===================================================================
--- sandbox/mapserver6/maplegend.c	2010-07-09 09:15:30 UTC (rev 10325)
+++ sandbox/mapserver6/maplegend.c	2010-07-09 09:34:26 UTC (rev 10326)
@@ -74,14 +74,14 @@
   box.line[0].point = (pointObj *)malloc(sizeof(pointObj)*5);
   box.line[0].numpoints = 5;
 
-  box.line[0].point[0].x = dstX;
-  box.line[0].point[0].y = dstY;
-  box.line[0].point[1].x = dstX + width - 1;
-  box.line[0].point[1].y = dstY;
-  box.line[0].point[2].x = dstX + width - 1;
-  box.line[0].point[2].y = dstY + height - 1;
-  box.line[0].point[3].x = dstX;
-  box.line[0].point[3].y = dstY + height - 1;
+  box.line[0].point[0].x = dstX + 0.5;
+  box.line[0].point[0].y = dstY + 0.5;
+  box.line[0].point[1].x = dstX + width - 0.5;
+  box.line[0].point[1].y = dstY + 0.5;
+  box.line[0].point[2].x = dstX + width - 0.5;
+  box.line[0].point[2].y = dstY + height - 0.5;
+  box.line[0].point[3].x = dstX + 0.5;
+  box.line[0].point[3].y = dstY + height - 0.5;
   box.line[0].point[4].x = box.line[0].point[0].x;
   box.line[0].point[4].y = box.line[0].point[0].y;
   box.line[0].numpoints = 5;

Modified: sandbox/mapserver6/mapscale.c
===================================================================
--- sandbox/mapserver6/mapscale.c	2010-07-09 09:15:30 UTC (rev 10325)
+++ sandbox/mapserver6/mapscale.c	2010-07-09 09:34:26 UTC (rev 10326)
@@ -258,10 +258,10 @@
 	  map->scalebar.color.alpha = 255;
 	  state = 1; /* 1 means filled */
 	  for(j=0; j<map->scalebar.intervals; j++) {
-		  points[0].x = points[4].x = points[3].x = ox + j*isx;
-		  points[0].y = points[4].y = points[1].y = oy;
-		  points[1].x = points[2].x = ox + (j+1)*isx;
-		  points[2].y = points[3].y = oy + map->scalebar.height;
+		  points[0].x = points[4].x = points[3].x = ox + j*isx + 0.5;
+		  points[0].y = points[4].y = points[1].y = oy + 0.5;
+		  points[1].x = points[2].x = ox + (j+1)*isx + 0.5;
+		  points[2].y = points[3].y = oy + map->scalebar.height + 0.5;
 		  if(state == 1 && MS_VALID_COLOR(map->scalebar.color))
 			  renderer->renderPolygon(image,&shape,&map->scalebar.color);
 		  else 



More information about the mapserver-commits mailing list