[mapserver-commits] r13205 - branches/branch-6-0/mapserver

svn at osgeo.org svn at osgeo.org
Tue Mar 6 16:12:23 EST 2012


Author: aboudreault
Date: 2012-03-06 13:12:23 -0800 (Tue, 06 Mar 2012)
New Revision: 13205

Modified:
   branches/branch-6-0/mapserver/mapdrawgdal.c
Log:
Fixed raster window offset when the layer is less than  half a pixel (on boundaries)

Modified: branches/branch-6-0/mapserver/mapdrawgdal.c
===================================================================
--- branches/branch-6-0/mapserver/mapdrawgdal.c	2012-03-06 11:20:38 UTC (rev 13204)
+++ branches/branch-6-0/mapserver/mapdrawgdal.c	2012-03-06 21:12:23 UTC (rev 13205)
@@ -251,10 +251,16 @@
                         GDALGetRasterYSize(hDS) - src_yoff);
 
        /* We want very small windows to use at least one source pixel (#4172) */
-       if( src_xsize == 0 && (urx - llx) > 0.0 )
+       if( src_xsize == 0 && (urx - llx) > 0.0 ) 
+       {
            src_xsize = 1;
+	   src_xoff = MIN(src_xoff,GDALGetRasterXSize(hDS)-1);
+       }
        if( src_ysize == 0 && (lly - ury) > 0.0 )
+       {
            src_ysize = 1;
+	   src_yoff = MIN(src_yoff,GDALGetRasterYSize(hDS)-1);
+       }
 
         if( src_xsize == 0 || src_ysize == 0 )
         {



More information about the mapserver-commits mailing list