[mapserver-commits] r12411 - trunk/mapserver/mapcache/src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:23:30 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:23:30 -0700 (Fri, 26 Aug 2011)
New Revision: 12411
Modified:
trunk/mapserver/mapcache/src/tileset.c
Log:
stop using the ngtemplate code, roll our own string replacement code.
thomas.bonfort | 2011-07-24 10:38:43 +0200 (Sun, 24 Jul 2011)
Modified: trunk/mapserver/mapcache/src/tileset.c
===================================================================
--- trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:23 UTC (rev 12410)
+++ trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:30 UTC (rev 12411)
@@ -108,12 +108,14 @@
cairo_surface_t* srcsurface= cairo_image_surface_create_for_data(im->data, CAIRO_FORMAT_ARGB32,
im->w, im->h,im->stride);
/*compute the pixel position of top left corner*/
- double dstminx = ((tilebbox[0]-bbox[0])/hresolution);
- double dstminy = ((bbox[3]-tilebbox[3])/vresolution);
+ double dstminx = floor((tilebbox[0]-bbox[0])/hresolution);
+ double dstminy = floor((bbox[3]-tilebbox[3])/vresolution);
double hf = tileresolution/hresolution;
double vf = tileresolution/vresolution;
- double dstwidth = (im->w*hf);
- double dstheight = (im->h*vf);
+ double dstwidth = ceil(im->w*hf);
+ double dstheight = ceil(im->h*vf);
+ hf = dstwidth/(double)im->w;
+ vf = dstheight/(double)im->h;
cairo_save(cr);
//cairo_clip(cr);
cairo_translate (cr, dstminx,dstminy);
More information about the mapserver-commits
mailing list