[mapserver-commits] r9383 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Oct 6 12:20:15 EDT 2009
Author: aboudreault
Date: 2009-10-06 12:20:15 -0400 (Tue, 06 Oct 2009)
New Revision: 9383
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapagg.cpp
trunk/mapserver/mapgd.c
trunk/mapserver/mapimagemap.c
trunk/mapserver/maplabel.c
trunk/mapserver/mappdf.c
trunk/mapserver/mapprimitive.c
trunk/mapserver/maprendering.c
trunk/mapserver/mapsvg.c
trunk/mapserver/mapswf.c
trunk/mapserver/mapsymbol.c
Log:
Fixed some style properties are not scaled with resolution (#3153)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/HISTORY.TXT 2009-10-06 16:20:15 UTC (rev 9383)
@@ -13,6 +13,9 @@
Current Version (SVN trunk):
----------------------------
+
+- Fixed some style properties are not scaled with resolution (#3153)
+
- Fixed anchor point of vertically stacked bar graphs
- Fixed TEXT property cannot be removed in the CLASS object. PHP/Mapscript (#3063)
Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapagg.cpp 2009-10-06 16:20:15 UTC (rev 9383)
@@ -1040,12 +1040,12 @@
size = size*scalefactor;
} else
size = style->size*scalefactor;
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = style->width*scalefactor;
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
angle_radians = angle*MS_DEG_TO_RAD;
@@ -1203,15 +1203,15 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
if (symbol->sizey)
d = size/symbol->sizey; /* compute the scaling factor (d) on the unrotated symbol */
else
d = 1;
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
angle_radians = angle*MS_DEG_TO_RAD;
@@ -1477,8 +1477,8 @@
}
else
size = style->size;
- if(size*scalefactor > style->maxsize) scalefactor = (float)style->maxsize/(float)size;
- if(size*scalefactor < style->minsize) scalefactor = (float)style->minsize/(float)size;
+ if(size*scalefactor > (style->maxsize*scalefactor)) scalefactor = (float)style->maxsize/(float)size;
+ if(size*scalefactor < (style->minsize*scalefactor)) scalefactor = (float)style->minsize/(float)size;
gap = MS_ABS(symbol->gap)* (int) scalefactor;
label.size = (size * scalefactor);
// label.minsize = style->minsize;
@@ -1571,12 +1571,12 @@
size = style->size;
size = (size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = (style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
ox = style->offsetx * scalefactor;
oy = style->offsety * scalefactor;
@@ -1760,12 +1760,12 @@
size = size*scalefactor;
} else
size = style->size*scalefactor;
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = style->width*scalefactor;
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle_radians = style->angle*MS_DEG_TO_RAD;
@@ -1979,8 +1979,8 @@
double size;
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
outlinewidth = label->outlinewidth*scalefactor;
shadowsizex = label->shadowsizex*scalefactor;
shadowsizey = label->shadowsizey*scalefactor;
@@ -2069,8 +2069,8 @@
char s[11]; /* UTF-8 characters can be up to 6 bytes wide, entities 10 (ϑ) */
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
outlinewidth = label->outlinewidth*scalefactor;
shadowsizex = label->shadowsizex*scalefactor;
shadowsizey = label->shadowsizey*scalefactor;
Modified: trunk/mapserver/mapgd.c
===================================================================
--- trunk/mapserver/mapgd.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapgd.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -72,8 +72,8 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
gap = MS_ABS(symbol->gap)* (int) scalefactor;
@@ -600,12 +600,12 @@
size = style->size;
size = MS_NINT(size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
gdImageSetThickness(hatch, width);
/* normalize the angle (180 to 0, 0 is east, 90 is north 180 is west) */
@@ -1072,12 +1072,12 @@
size = style->size;
size = MS_NINT(size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if(style->symbol >= symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK */
if(fc < 0) return; /* nothing to do */
@@ -1284,12 +1284,12 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
angle_radians = angle*MS_DEG_TO_RAD;
@@ -1504,12 +1504,12 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
angle_radians = angle*MS_DEG_TO_RAD;
@@ -1748,12 +1748,12 @@
/* if(size*scalefactor < style->minsize) scalefactor = (float)style->minsize/(float)size; */
size = MS_NINT(size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
@@ -2025,12 +2025,12 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
angle = (style->angle) ? style->angle : 0.0;
angle_radians = angle*MS_DEG_TO_RAD;
@@ -2882,8 +2882,8 @@
double size;
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
#ifdef USE_GD_FT
if(!fontset) {
@@ -3004,8 +3004,8 @@
char s[11]; /* UTF-8 characters can be up to 6 bytes wide, html entities 10 */
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
shadowsizex = label->shadowsizex*scalefactor;
shadowsizey = label->shadowsizey*scalefactor;
Modified: trunk/mapserver/mapimagemap.c
===================================================================
--- trunk/mapserver/mapimagemap.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapimagemap.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -989,8 +989,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK */
/* if(fc<0 && oc<0) return; // nothing to do */
@@ -1197,8 +1197,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK */
if (suppressEmpty && p->numvalues==0) return;/* suppress area with empty title */
@@ -1410,8 +1410,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
/* DEBUG_IF printf ("a"); */
/* if(fc==-1 && oc!=-1) { // use msDrawLineSymbolIM() instead (POLYLINE) */
Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/maplabel.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -779,8 +779,8 @@
char *font=NULL;
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
font = msLookupHashTable(&(fontset->fonts), label->font);
if(!font) {
Modified: trunk/mapserver/mappdf.c
===================================================================
--- trunk/mapserver/mappdf.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mappdf.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -806,8 +806,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
/* no such symbol, 0 is OK */
if(style->symbol > symbolset->numsymbols || style->symbol < 0)
Modified: trunk/mapserver/mapprimitive.c
===================================================================
--- trunk/mapserver/mapprimitive.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapprimitive.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -1622,8 +1622,8 @@
}
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
font = msLookupHashTable(&(fontset->fonts), label->font);
if(!font) {
Modified: trunk/mapserver/maprendering.c
===================================================================
--- trunk/mapserver/maprendering.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/maprendering.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -102,8 +102,8 @@
if(MS_VALID_COLOR(s->outlinecolor)) {
s->outlinewidth = src->width * scalefactor;
- s->outlinewidth = MS_MAX(s->outlinewidth, src->minwidth);
- s->outlinewidth = MS_MIN(s->outlinewidth, src->maxwidth);
+ s->outlinewidth = MS_MAX(s->outlinewidth, (src->minwidth*scalefactor));
+ s->outlinewidth = MS_MIN(s->outlinewidth, (src->maxwidth*scalefactor));
} else {
s->outlinewidth = 0;
}
@@ -417,9 +417,9 @@
/* store a reference to the renderer to be used for freeing */
symbol->renderer = renderer;
- width = style->width * scalefactor;
- width = MS_MIN(width,style->maxwidth);
- width = MS_MAX(width,style->minwidth);
+ width = style->width * scalefactor;
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
+ width = MS_MAX(width, (style->minwidth*scalefactor));
if(style->offsety==-99) {
offsetLine = msOffsetPolyline(p,style->offsetx * width,-99);
@@ -588,8 +588,8 @@
size = MS_MIN(size, style->maxsize);
width = style->width * scalefactor;
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if (symbol->sizey)
scaling = size / symbol->sizey; /* compute the scaling factor (d) on the unrotated symbol */
Modified: trunk/mapserver/mapsvg.c
===================================================================
--- trunk/mapserver/mapsvg.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapsvg.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -542,15 +542,15 @@
size = style->size;
/* TODO: Don't get this modification, is it needed elsewhere? */
- if(size*scalefactor > style->maxsize) scalefactor = (float)style->maxsize/(float)size;
- if(size*scalefactor < style->minsize) scalefactor = (float)style->minsize/(float)size;
+ if(size*scalefactor > (style->maxsize*scalefactor)) scalefactor = (float)style->maxsize/(float)size;
+ if(size*scalefactor < (style->minsize*scalefactor)) scalefactor = (float)style->minsize/(float)size;
size = MS_NINT(size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK */
@@ -756,8 +756,8 @@
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
/* scale the symbol pattern */
if (symbol->patternlength > 0)
@@ -1074,8 +1074,8 @@
/* position, offset, angle, buffer, antialias, wrap, encoding */
size = label->size*scalefactor;
- size = MS_MAX(size, label->minsize);
- size = MS_MIN(size, label->maxsize);
+ size = MS_MAX(size, (label->minsize*scalefactor));
+ size = MS_MIN(size, (label->maxsize*scalefactor));
if(!fontset) {
msSetError(MS_TTFERR, "No fontset defined.", "msDrawTextSVG()");
@@ -1360,12 +1360,12 @@
size = MS_NINT(size*scalefactor);
} else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK */
Modified: trunk/mapserver/mapswf.c
===================================================================
--- trunk/mapserver/mapswf.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapswf.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -1476,8 +1476,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) /* no such symbol, 0 is OK */
@@ -1983,15 +1983,15 @@
size = MS_NINT(style->size*scalefactor);
/* TODO: Don't get this modification, is it needed elsewhere? */
- if(size*scalefactor > style->maxsize) scalefactor = (float)style->maxsize/(float)size;
- if(size*scalefactor < style->minsize) scalefactor = (float)style->minsize/(float)size;
+ if(size*scalefactor > (style->maxsize*scalefactor)) scalefactor = (float)style->maxsize/(float)size;
+ if(size*scalefactor < (style->minsize*scalefactor)) scalefactor = (float)style->minsize/(float)size;
size = MS_NINT(size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) /* no such symbol, 0 is OK */
return;
@@ -2115,13 +2115,13 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
width = MS_NINT(style->width*scalefactor);
- width = MS_MAX(width, style->minwidth);
- width = MS_MIN(width, style->maxwidth);
+ width = MS_MAX(width, (style->minwidth*scalefactor));
+ width = MS_MIN(width, (style->maxwidth*scalefactor));
if(style->symbol > symbolset->numsymbols || style->symbol < 0) /* no such symbol, 0 is OK */
return;
Modified: trunk/mapserver/mapsymbol.c
===================================================================
--- trunk/mapserver/mapsymbol.c 2009-10-06 16:19:09 UTC (rev 9382)
+++ trunk/mapserver/mapsymbol.c 2009-10-06 16:20:15 UTC (rev 9383)
@@ -745,8 +745,8 @@
}
else
size = MS_NINT(style->size*scalefactor);
- size = MS_MAX(size, style->minsize);
- size = MS_MIN(size, style->maxsize);
+ size = MS_MAX(size, (style->minsize*scalefactor));
+ size = MS_MIN(size, (style->maxsize*scalefactor));
switch(symbolset->symbol[style->symbol]->type) {
More information about the mapserver-commits
mailing list