31
31
#include "mapcopy.h"
32
32
33
33
int computeLabelStyle (labelStyleObj * s , labelObj * l , fontSetObj * fontset ,
34
- double scalefactor )
34
+ double scalefactor , double resolutionfactor )
35
35
{
36
36
INIT_LABEL_STYLE (* s );
37
37
if (!MS_VALID_COLOR (l -> color ))
@@ -42,8 +42,8 @@ int computeLabelStyle(labelStyleObj *s, labelObj *l, fontSetObj *fontset,
42
42
s -> size = l -> size ;
43
43
if (l -> type == MS_TRUETYPE ) {
44
44
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 );
47
47
if (!fontset ) {
48
48
msSetError (MS_TTFERR , "No fontset defined." ,"computeLabelStyle()" );
49
49
return (MS_FAILURE );
@@ -61,7 +61,9 @@ int computeLabelStyle(labelStyleObj *s, labelObj *l, fontSetObj *fontset,
61
61
s -> antialias = l -> antialias ;
62
62
return MS_SUCCESS ;
63
63
}
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 )
65
67
{
66
68
double default_size ;
67
69
double target_size ;
@@ -92,15 +94,15 @@ void computeSymbolStyle(symbolStyleObj *s, styleObj *src, symbolObj *symbol, dou
92
94
}
93
95
94
96
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 );
97
99
s -> scale = target_size / default_size ;
98
100
s -> gap = src -> gap * target_size / style_size ;
99
101
100
102
if (s -> outlinecolor ) {
101
103
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 );
104
106
} else {
105
107
s -> outlinewidth = 0 ;
106
108
}
@@ -481,8 +483,8 @@ int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p,
481
483
symbol -> renderer = renderer ;
482
484
483
485
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 );
486
488
if (style -> width != 0 ) {
487
489
finalscalefactor = width / style -> width ;
488
490
} else {
@@ -539,7 +541,7 @@ int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p,
539
541
}
540
542
541
543
INIT_SYMBOL_STYLE (s );
542
- computeSymbolStyle (& s ,style ,symbol ,scalefactor );
544
+ computeSymbolStyle (& s ,style ,symbol ,scalefactor , image -> resolutionfactor );
543
545
s .style = style ;
544
546
if (symbol -> type == MS_SYMBOL_TRUETYPE ) {
545
547
if (!symbol -> full_font_path )
@@ -665,11 +667,11 @@ int msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, sty
665
667
if (ret != MS_SUCCESS ) goto cleanup ;
666
668
}
667
669
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 );
670
672
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 );
673
675
674
676
/* scale the pattern by the factor applied to the width */
675
677
for (i = 0 ; i < style -> patternlength ; i ++ ) {
@@ -723,7 +725,7 @@ int msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, sty
723
725
}
724
726
725
727
INIT_SYMBOL_STYLE (s );
726
- computeSymbolStyle (& s ,style ,symbol ,scalefactor );
728
+ computeSymbolStyle (& s ,style ,symbol ,scalefactor , image -> resolutionfactor );
727
729
s .style = style ;
728
730
729
731
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
832
834
}
833
835
834
836
s .style = style ;
835
- computeSymbolStyle (& s ,style ,symbol ,scalefactor );
837
+ computeSymbolStyle (& s ,style ,symbol ,scalefactor , image -> resolutionfactor );
836
838
s .style = style ;
837
839
if (!s .color && !s .outlinecolor && symbol -> type != MS_SYMBOL_PIXMAP &&
838
840
symbol -> type != MS_SYMBOL_SVG ) {
@@ -953,7 +955,7 @@ int msDrawText(imageObj *image, pointObj labelPnt, char *string,
953
955
return (0 ); /* not errors, just don't want to do anything */
954
956
955
957
956
- if (computeLabelStyle (& s ,label ,fontset ,scalefactor ) == MS_FAILURE ) {
958
+ if (computeLabelStyle (& s ,label ,fontset ,scalefactor , image -> resolutionfactor ) == MS_FAILURE ) {
957
959
return MS_FAILURE ;
958
960
}
959
961
if (s .rotation == 0 && !MS_RENDERER_KML (image -> format )) {
@@ -1004,7 +1006,7 @@ int msDrawTextLine(imageObj *image, char *string, labelObj *label, labelPathObj
1004
1006
labelStyleObj s ;
1005
1007
if (!string || !strlen (string ))
1006
1008
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 ;
1008
1010
if (label -> type == MS_TRUETYPE ) {
1009
1011
if (renderer -> renderGlyphsLine ) {
1010
1012
if (MS_VALID_COLOR (label -> outlinecolor )) {
0 commit comments