[mapserver-commits] r13204 - sandbox/tb-labels
svn at osgeo.org
svn at osgeo.org
Tue Mar 6 06:20:38 EST 2012
Author: tbonfort
Date: 2012-03-06 03:20:38 -0800 (Tue, 06 Mar 2012)
New Revision: 13204
Modified:
sandbox/tb-labels/mapdraw.c
sandbox/tb-labels/maprendering.c
sandbox/tb-labels/mapsymbol.c
Log:
fix usage of msGetMarkerSize from labelcache (#4225)
Modified: sandbox/tb-labels/mapdraw.c
===================================================================
--- sandbox/tb-labels/mapdraw.c 2012-03-06 10:57:46 UTC (rev 13203)
+++ sandbox/tb-labels/mapdraw.c 2012-03-06 11:20:38 UTC (rev 13204)
@@ -2649,19 +2649,6 @@
style->symbol < map->symbolset.numsymbols && style->symbol > 0) {
double sx,sy;
symbolObj *symbol = map->symbolset.symbol[style->symbol];
-
- if (symbol->type == MS_SYMBOL_PIXMAP) {
- if (MS_SUCCESS != msPreloadImageSymbol(MS_MAP_RENDERER(map), symbol))
- return MS_FAILURE;
- } else if (symbol->type == MS_SYMBOL_SVG) {
-#ifdef USE_SVG_CAIRO
- if (MS_SUCCESS != msPreloadSVGSymbol(symbol))
- return MS_FAILURE;
-#else
- msSetError(MS_SYMERR, "SVG symbol support is not enabled.", "msDrawShape()");
- return MS_FAILURE;
-#endif
- }
if(msGetMarkerSize(&map->symbolset, style, &sx, &sy, layerPtr->scalefactor) != MS_SUCCESS)
return MS_FAILURE;
pointObj *point = markerPoly->line[0].point;
Modified: sandbox/tb-labels/maprendering.c
===================================================================
--- sandbox/tb-labels/maprendering.c 2012-03-06 10:57:46 UTC (rev 13203)
+++ sandbox/tb-labels/maprendering.c 2012-03-06 11:20:38 UTC (rev 13204)
@@ -812,39 +812,41 @@
symbolObj *symbol = symbolset->symbol[style->symbol];
/* store a reference to the renderer to be used for freeing */
symbol->renderer = renderer;
- switch (symbol->type)
- {
- case (MS_SYMBOL_TRUETYPE): {
- if(!symbol->full_font_path)
- symbol->full_font_path = msStrdup(msLookupHashTable(&(symbolset->fontset->fonts),
- symbol->font));
- if(!symbol->full_font_path) {
- msSetError(MS_MEMERR,"allocation error", "msDrawMarkerSymbol()");
- return MS_FAILURE;
- }
- }
- break;
- case (MS_SYMBOL_PIXMAP): {
- if(!symbol->pixmap_buffer) {
- if(MS_SUCCESS != msPreloadImageSymbol(renderer,symbol))
- return MS_FAILURE;
- }
- }
- break;
-
- case (MS_SYMBOL_SVG): {
+ switch (symbol->type) {
+ case (MS_SYMBOL_TRUETYPE):
+ {
+ if (!symbol->full_font_path)
+ symbol->full_font_path = msStrdup(msLookupHashTable(&(symbolset->fontset->fonts),
+ symbol->font));
+ if (!symbol->full_font_path) {
+ msSetError(MS_MEMERR, "allocation error", "msDrawMarkerSymbol()");
+ return MS_FAILURE;
+ }
+ }
+ break;
+ case (MS_SYMBOL_PIXMAP):
+ {
+ if (!symbol->pixmap_buffer) {
+ if (MS_SUCCESS != msPreloadImageSymbol(renderer, symbol))
+ return MS_FAILURE;
+ }
+ }
+ break;
+
+ case (MS_SYMBOL_SVG):
+ {
#ifdef USE_SVG_CAIRO
- if(!symbol->svg_cairo_surface) {
- if(MS_SUCCESS != msPreloadSVGSymbol(symbol))
- return MS_FAILURE;
- }
+ if (!symbol->svg_cairo_surface) {
+ if (MS_SUCCESS != msPreloadSVGSymbol(symbol))
+ return MS_FAILURE;
+ }
#else
- msSetError(MS_SYMERR, "SVG symbol support is not enabled.", "msDrawMarkerSymbol()");
- return MS_FAILURE;
+ msSetError(MS_SYMERR, "SVG symbol support is not enabled.", "msDrawMarkerSymbol()");
+ return MS_FAILURE;
#endif
- }
- break;
- }
+ }
+ break;
+ }
s.style = style;
computeSymbolStyle(&s,style,symbol,scalefactor);
Modified: sandbox/tb-labels/mapsymbol.c
===================================================================
--- sandbox/tb-labels/mapsymbol.c 2012-03-06 10:57:46 UTC (rev 13203)
+++ sandbox/tb-labels/mapsymbol.c 2012-03-06 11:20:38 UTC (rev 13204)
@@ -681,9 +681,9 @@
#endif
case(MS_SYMBOL_PIXMAP):
- if(!symbol->pixmap_buffer) {
- msSetError(MS_MISCERR,"msGetMarkerSize() called on unloaded pixmap symbol, this is a bug in mapserver itself","msGetMArkerSize()");
- return MS_FAILURE;
+ if (!symbol->pixmap_buffer) {
+ if (MS_SUCCESS != msPreloadImageSymbol(MS_MAP_RENDERER(symbolset->map), symbol))
+ return MS_FAILURE;
}
if(size == 1) {
*width = MS_MAX(*width, symbol->pixmap_buffer->width);
More information about the mapserver-commits
mailing list