Skip to content

Commit 758f9f6

Browse files
committed
Merge branch 'branch-6-2'
2 parents d6c4e23 + 9531df6 commit 758f9f6

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

maprendering.c

+21-19
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "mapcopy.h"
3232

3333
int computeLabelStyle(labelStyleObj *s, labelObj *l, fontSetObj *fontset,
34-
double scalefactor)
34+
double scalefactor, double resolutionfactor)
3535
{
3636
INIT_LABEL_STYLE(*s);
3737
if(!MS_VALID_COLOR(l->color))
@@ -42,8 +42,8 @@ int computeLabelStyle(labelStyleObj *s, labelObj *l, fontSetObj *fontset,
4242
s->size = l->size;
4343
if(l->type == MS_TRUETYPE) {
4444
s->size *= scalefactor;
45-
s->size = MS_MAX(s->size, l->minsize);
46-
s->size = MS_MIN(s->size, l->maxsize);
45+
s->size = MS_MAX(s->size, l->minsize*resolutionfactor);
46+
s->size = MS_MIN(s->size, l->maxsize*resolutionfactor);
4747
if (!fontset) {
4848
msSetError(MS_TTFERR, "No fontset defined.","computeLabelStyle()");
4949
return (MS_FAILURE);
@@ -61,7 +61,9 @@ int computeLabelStyle(labelStyleObj *s, labelObj *l, fontSetObj *fontset,
6161
s->antialias = l->antialias;
6262
return MS_SUCCESS;
6363
}
64-
void computeSymbolStyle(symbolStyleObj *s, styleObj *src, symbolObj *symbol, double scalefactor)
64+
65+
void computeSymbolStyle(symbolStyleObj *s, styleObj *src, symbolObj *symbol, double scalefactor,
66+
double resolutionfactor)
6567
{
6668
double default_size;
6769
double target_size;
@@ -92,15 +94,15 @@ void computeSymbolStyle(symbolStyleObj *s, styleObj *src, symbolObj *symbol, dou
9294
}
9395

9496
target_size = style_size * scalefactor;
95-
target_size = MS_MAX(target_size, src->minsize);
96-
target_size = MS_MIN(target_size, src->maxsize);
97+
target_size = MS_MAX(target_size, src->minsize*resolutionfactor);
98+
target_size = MS_MIN(target_size, src->maxsize*resolutionfactor);
9799
s->scale = target_size / default_size;
98100
s->gap = src->gap * target_size / style_size;
99101

100102
if(s->outlinecolor) {
101103
s->outlinewidth = src->width * scalefactor;
102-
s->outlinewidth = MS_MAX(s->outlinewidth, src->minwidth);
103-
s->outlinewidth = MS_MIN(s->outlinewidth, src->maxwidth);
104+
s->outlinewidth = MS_MAX(s->outlinewidth, src->minwidth*resolutionfactor);
105+
s->outlinewidth = MS_MIN(s->outlinewidth, src->maxwidth*resolutionfactor);
104106
} else {
105107
s->outlinewidth = 0;
106108
}
@@ -481,8 +483,8 @@ int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p,
481483
symbol->renderer = renderer;
482484

483485
width = style->width * scalefactor;
484-
width = MS_MIN(width,style->maxwidth);
485-
width = MS_MAX(width,style->minwidth);
486+
width = MS_MIN(width,style->maxwidth*image->resolutionfactor);
487+
width = MS_MAX(width,style->minwidth*image->resolutionfactor);
486488
if(style->width != 0) {
487489
finalscalefactor = width / style->width;
488490
} else {
@@ -539,7 +541,7 @@ int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p,
539541
}
540542

541543
INIT_SYMBOL_STYLE(s);
542-
computeSymbolStyle(&s,style,symbol,scalefactor);
544+
computeSymbolStyle(&s,style,symbol,scalefactor,image->resolutionfactor);
543545
s.style = style;
544546
if(symbol->type == MS_SYMBOL_TRUETYPE) {
545547
if(!symbol->full_font_path)
@@ -665,11 +667,11 @@ int msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, sty
665667
if(ret != MS_SUCCESS) goto cleanup;
666668
}
667669
width = (style->width <= 0)?scalefactor:style->width*scalefactor;
668-
width = MS_MIN(width, style->maxwidth);
669-
width = MS_MAX(width, style->minwidth);
670+
width = MS_MIN(width, style->maxwidth*image->resolutionfactor);
671+
width = MS_MAX(width, style->minwidth*image->resolutionfactor);
670672
spacing = (style->size <= 0)?scalefactor:style->size*scalefactor;
671-
spacing = MS_MIN(spacing, style->maxsize);
672-
spacing = MS_MAX(spacing, style->minsize);
673+
spacing = MS_MIN(spacing, style->maxsize*image->resolutionfactor);
674+
spacing = MS_MAX(spacing, style->minsize*image->resolutionfactor);
673675

674676
/* scale the pattern by the factor applied to the width */
675677
for(i=0; i<style->patternlength; i++) {
@@ -723,7 +725,7 @@ int msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, sty
723725
}
724726

725727
INIT_SYMBOL_STYLE(s);
726-
computeSymbolStyle(&s,style,symbol,scalefactor);
728+
computeSymbolStyle(&s,style,symbol,scalefactor,image->resolutionfactor);
727729
s.style = style;
728730

729731
if (!s.color && !s.outlinecolor && symbol->type != MS_SYMBOL_PIXMAP && symbol->type != MS_SYMBOL_SVG) {
@@ -832,7 +834,7 @@ int msDrawMarkerSymbol(symbolSetObj *symbolset,imageObj *image, pointObj *p, sty
832834
}
833835

834836
s.style = style;
835-
computeSymbolStyle(&s,style,symbol,scalefactor);
837+
computeSymbolStyle(&s,style,symbol,scalefactor,image->resolutionfactor);
836838
s.style = style;
837839
if (!s.color && !s.outlinecolor && symbol->type != MS_SYMBOL_PIXMAP &&
838840
symbol->type != MS_SYMBOL_SVG) {
@@ -953,7 +955,7 @@ int msDrawText(imageObj *image, pointObj labelPnt, char *string,
953955
return (0); /* not errors, just don't want to do anything */
954956

955957

956-
if(computeLabelStyle(&s,label,fontset,scalefactor) == MS_FAILURE) {
958+
if(computeLabelStyle(&s,label,fontset,scalefactor,image->resolutionfactor) == MS_FAILURE) {
957959
return MS_FAILURE;
958960
}
959961
if(s.rotation == 0 && !MS_RENDERER_KML(image->format)) {
@@ -1004,7 +1006,7 @@ int msDrawTextLine(imageObj *image, char *string, labelObj *label, labelPathObj
10041006
labelStyleObj s;
10051007
if (!string || !strlen(string))
10061008
return (MS_SUCCESS); /* not errors, just don't want to do anything */
1007-
if(computeLabelStyle(&s, label, fontset, scalefactor) != MS_SUCCESS) return MS_FAILURE;
1009+
if(computeLabelStyle(&s, label, fontset, scalefactor,image->resolutionfactor) != MS_SUCCESS) return MS_FAILURE;
10081010
if (label->type == MS_TRUETYPE) {
10091011
if(renderer->renderGlyphsLine) {
10101012
if(MS_VALID_COLOR(label->outlinecolor)) {

mapwms.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ int msDumpLayer(mapObj *map, layerObj *lp, int nVersion, const char *script_url_
20232023
const char *pszLegendURL=NULL;
20242024
char *pszMetadataName=NULL, *mimetype=NULL;
20252025
char **classgroups = NULL;
2026-
int iclassgroups=0 ,j=0;
2026+
int iclassgroups=0;
20272027
char szVersionBuf[OWS_VERSION_MAXLEN];
20282028
size_t bufferSize = 0;
20292029
const char *pszDimensionlist=NULL;
@@ -2355,7 +2355,7 @@ int msDumpLayer(mapObj *map, layerObj *lp, int nVersion, const char *script_url_
23552355
}
23562356
}
23572357
if (classnameset) {
2358-
int k, l, size_x=0, size_y=0, num_layers=0;
2358+
int j=0, k=0, l=0, size_x=0, size_y=0, num_layers=0;
23592359
int *group_layers = (int *)msSmallMalloc(sizeof(int)*map->numlayers);
23602360
char ***nestedGroups = NULL;
23612361
int *numNestedGroups = NULL;

0 commit comments

Comments
 (0)