[mapserver-commits] r9476 - sandbox/aggplugin/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Oct 17 06:04:02 EDT 2009
Author: tbonfort
Date: 2009-10-17 06:04:01 -0400 (Sat, 17 Oct 2009)
New Revision: 9476
Modified:
sandbox/aggplugin/mapserver/mapagg2.cpp
sandbox/aggplugin/mapserver/mapdraw.c
sandbox/aggplugin/mapserver/maplabel.c
sandbox/aggplugin/mapserver/maprendering.c
Log:
apply resolution factor for plugin renderers
Modified: sandbox/aggplugin/mapserver/mapagg2.cpp
===================================================================
--- sandbox/aggplugin/mapserver/mapagg2.cpp 2009-10-16 21:37:04 UTC (rev 9475)
+++ sandbox/aggplugin/mapserver/mapagg2.cpp 2009-10-17 10:04:01 UTC (rev 9476)
@@ -147,7 +147,8 @@
if (i < style->patternlength - 1) {
- dash.add_dash(MS_NINT(style->pattern[i]), MS_NINT(style->pattern[i + 1]));
+ dash.add_dash(MS_MAX(1,MS_NINT(style->pattern[i])),
+ MS_MAX(1,MS_NINT(style->pattern[i + 1])));
}
stroke_dash.width(style->width);
applyCJC(stroke_dash, style->linecap, style->linejoin);
@@ -193,7 +194,7 @@
mapserver::trans_affine mtx;
mtx *= mapserver::trans_affine_translation(-x, -y);
/*agg angles are antitrigonometric*/
- mtx *= mapserver::trans_affine_rotation(style->rotation);
+ mtx *= mapserver::trans_affine_rotation(-style->rotation);
mtx *= mapserver::trans_affine_translation(x, y);
double fx = x, fy = y;
Modified: sandbox/aggplugin/mapserver/mapdraw.c
===================================================================
--- sandbox/aggplugin/mapserver/mapdraw.c 2009-10-16 21:37:04 UTC (rev 9475)
+++ sandbox/aggplugin/mapserver/mapdraw.c 2009-10-17 10:04:01 UTC (rev 9476)
@@ -157,6 +157,9 @@
image->format->refcount++;
image->width = map->width;
image->height = map->height;
+
+ image->resolution = map->resolution;
+ image->resolutionfactor = map->resolution/map->defresolution;
if (map->web.imagepath)
image->imagepath = strdup(map->web.imagepath);
if (map->web.imageurl)
Modified: sandbox/aggplugin/mapserver/maplabel.c
===================================================================
--- sandbox/aggplugin/mapserver/maplabel.c 2009-10-16 21:37:04 UTC (rev 9475)
+++ sandbox/aggplugin/mapserver/maplabel.c 2009-10-17 10:04:01 UTC (rev 9476)
@@ -668,13 +668,13 @@
#ifdef USE_GD_FT
if(img!=NULL && MS_RENDERER_PLUGIN(img->format)) {
img->format->vtable->getTruetypeTextBBox(img,font,size,string,rect,advances);
- //printf("%s: %f %f %f %f\n",string,rect->minx,rect->miny,rect->maxx,rect->maxy);
+ //printf("%s (%f): %f %f %f %f\n",string,size,rect->minx,rect->miny,rect->maxx,rect->maxy);
return MS_SUCCESS;
} else
#ifdef USE_AGG
if(img!=NULL && MS_RENDERER_AGG(img->format)) {
msGetTruetypeTextBBoxAGG(img,font,size,string,rect,advances);
- //printf("%s: %f %f %f %f\n",string,rect->minx,rect->miny,rect->maxx,rect->maxy);
+ //printf("%s (%f): %f %f %f %f\n",string,size,rect->minx,rect->miny,rect->maxx,rect->maxy);
return MS_SUCCESS;
} else
#endif
@@ -777,7 +777,6 @@
if(label->type == MS_TRUETYPE) {
#ifdef USE_GD_FT
char *font=NULL;
-
size = label->size*scalefactor;
if (img != NULL) {
size = MS_MAX(size, label->minsize*img->resolutionfactor);
Modified: sandbox/aggplugin/mapserver/maprendering.c
===================================================================
--- sandbox/aggplugin/mapserver/maprendering.c 2009-10-16 21:37:04 UTC (rev 9475)
+++ sandbox/aggplugin/mapserver/maprendering.c 2009-10-17 10:04:01 UTC (rev 9476)
@@ -418,8 +418,8 @@
symbol->renderer = renderer;
width = style->width * scalefactor;
- width = MS_MIN(width,style->maxwidth);
- width = MS_MAX(width,style->minwidth);
+ width = MS_MIN(width,style->maxwidth*image->resolutionfactor);
+ width = MS_MAX(width,style->minwidth*image->resolutionfactor);
if(style->offsety==-99) {
offsetLine = msOffsetPolyline(p,style->offsetx * width,-99);
More information about the mapserver-commits
mailing list