[mapserver-commits] r9479 - sandbox/aggplugin/mapserver

svn at osgeo.org svn at osgeo.org
Sat Oct 17 10:29:09 EDT 2009


Author: tbonfort
Date: 2009-10-17 10:29:08 -0400 (Sat, 17 Oct 2009)
New Revision: 9479

Modified:
   sandbox/aggplugin/mapserver/mapagg2.cpp
   sandbox/aggplugin/mapserver/maprendering.c
Log:
fix order of angle follow outline rendering


Modified: sandbox/aggplugin/mapserver/mapagg2.cpp
===================================================================
--- sandbox/aggplugin/mapserver/mapagg2.cpp	2009-10-17 13:50:13 UTC (rev 9478)
+++ sandbox/aggplugin/mapserver/mapagg2.cpp	2009-10-17 14:29:08 UTC (rev 9479)
@@ -468,10 +468,10 @@
       glyph = r->m_fman.glyph(unicode);
       if (glyph) {
          double t;
-         if ((t = fx + glyph->bounds.x1) < rect->minx) rect->minx = t;
-         if ((t = fx + glyph->bounds.x2) > rect->maxx) rect->maxx = t;
-         if ((t = fy + glyph->bounds.y1) < rect->miny) rect->miny = t;
-         if ((t = fy + glyph->bounds.y2) > rect->maxy) rect->maxy = t;
+         rect->minx = MS_MIN(rect->minx, fx+glyph->bounds.x1);
+         rect->miny = MS_MIN(rect->miny, fy+glyph->bounds.y1);
+         rect->maxx = MS_MAX(rect->maxx, fx+glyph->bounds.x2);
+         rect->maxy = MS_MAX(rect->maxy, fy+glyph->bounds.y2);
 
          fx += glyph->advance_x;
          fy += glyph->advance_y;

Modified: sandbox/aggplugin/mapserver/maprendering.c
===================================================================
--- sandbox/aggplugin/mapserver/maprendering.c	2009-10-17 13:50:13 UTC (rev 9478)
+++ sandbox/aggplugin/mapserver/maprendering.c	2009-10-17 14:29:08 UTC (rev 9479)
@@ -62,7 +62,7 @@
       if (MS_VALID_COLOR(l->outlinecolor)) {
          MS_COPYCOLOR(&s->outlinecolor, &l->outlinecolor);
          s->outlinecolor.alpha = 255;
-         s->outlinewidth = s->size / l->size * l->outlinewidth;
+         s->outlinewidth = l->outlinewidth;
       }
    }
    MS_COPYCOLOR(&s->color, &l->color);
@@ -835,9 +835,27 @@
          if (label->type == MS_TRUETYPE) {
             const char* string_ptr = string;
             int i;
+            double x, y;
+            char glyph[11];
+            if(MS_VALID_COLOR(s.outlinecolor)) {
+               colorObj storecolor;
+               MS_COPYCOLOR(&storecolor,&(s.color));
+               MS_INIT_COLOR(s.color,-1,-1,-1);
+               for (i = 0; i < labelpath->path.numpoints; i++) {
+                  if (msGetNextGlyph(&string_ptr, glyph) == -1)
+                     break; /* Premature end of string??? */
+
+                  s.rotation = labelpath->angles[i];
+                  x = labelpath->path.point[i].x;
+                  y = labelpath->path.point[i].y;
+
+                  renderer->renderGlyphs(image, x, y, &s, glyph);
+               }
+               MS_INIT_COLOR(s.outlinecolor,-1,-1,-1);
+               MS_COPYCOLOR(&(s.color),&storecolor);
+               string_ptr = string;
+            }
             for (i = 0; i < labelpath->path.numpoints; i++) {
-               double x, y;
-               char glyph[11];
                if (msGetNextGlyph(&string_ptr, glyph) == -1)
                   break; /* Premature end of string??? */
 



More information about the mapserver-commits mailing list