[mapserver-commits] r7973 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Oct 11 10:42:45 EDT 2008
Author: tbonfort
Date: 2008-10-11 10:42:45 -0400 (Sat, 11 Oct 2008)
New Revision: 7973
Modified:
trunk/mapserver/mapagg.cpp
trunk/mapserver/mapserver.h
trunk/mapserver/maputil.c
Log:
scale offsets on line layers
Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp 2008-10-11 12:34:58 UTC (rev 7972)
+++ trunk/mapserver/mapagg.cpp 2008-10-11 14:42:45 UTC (rev 7973)
@@ -1567,6 +1567,7 @@
{
double width;
double nwidth, size;
+ double ox,oy;
symbolObj *symbol;
AGGMapserverRenderer* ren = getAGGRenderer(image);
shapeObj *offsetLine = NULL;
@@ -1590,6 +1591,9 @@
width = MS_MAX(width, style->minwidth);
width = MS_MIN(width, style->maxwidth);
+ ox = style->offsetx * scalefactor;
+ oy = style->offsety * scalefactor;
+
agg::rgba8 agg_color,agg_ocolor,agg_bcolor;
agg_color=getAGGColor(&style->color,style->opacity);
agg_ocolor=getAGGColor(&style->outlinecolor,style->opacity);
@@ -1609,13 +1613,13 @@
line_adaptor *lines;
if(style->offsety==-99) {
- offsetLine = msOffsetPolyline(p,style->offsetx,style->offsety);
+ offsetLine = msOffsetPolyline(p,ox,-99);
}
if(offsetLine!=NULL) {
lines=new line_adaptor(offsetLine);
} else {
if(style->offsetx!=0 || style->offsety!=0) {
- lines=new offset_line_adaptor(p,style->offsetx,style->offsety);
+ lines=new offset_line_adaptor(p,ox,oy);
} else {
lines=new line_adaptor(p);
}
@@ -1782,7 +1786,7 @@
AGGMapserverRenderer* ren = getAGGRenderer(image);
polygon_adaptor *polygons;
if(style->offsety==-99) {
- offsetPolygon = msOffsetPolyline(p,ox,style->offsety);
+ offsetPolygon = msOffsetPolyline(p,ox,-99);
}
if(offsetPolygon!=NULL) {
polygons=new polygon_adaptor(offsetPolygon);
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2008-10-11 12:34:58 UTC (rev 7972)
+++ trunk/mapserver/mapserver.h 2008-10-11 14:42:45 UTC (rev 7973)
@@ -2005,7 +2005,7 @@
MS_DLL_EXPORT int msConstrainExtent(rectObj *bounds, rectObj *rect, double overlay);
MS_DLL_EXPORT int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *nCount);
MS_DLL_EXPORT unsigned char *msSaveImageBuffer(imageObj* image, int *size_ptr, outputFormatObj *format);
-MS_DLL_EXPORT shapeObj* msOffsetPolyline(shapeObj* shape, int offsetx, int offsety);
+MS_DLL_EXPORT shapeObj* msOffsetPolyline(shapeObj* shape, double offsetx, double offsety);
/* Functions to chnage the drawing order of the layers. */
/* Defined in mapobject.c */
MS_DLL_EXPORT int msMoveLayerUp(mapObj *map, int nLayerIndex);
Modified: trunk/mapserver/maputil.c
===================================================================
--- trunk/mapserver/maputil.c 2008-10-11 12:34:58 UTC (rev 7972)
+++ trunk/mapserver/maputil.c 2008-10-11 14:42:45 UTC (rev 7973)
@@ -1470,7 +1470,7 @@
msTransformShapeToPixel(shape, extent, cellsize);
}
-shapeObj* msOffsetPolyline(shapeObj *p, int offsetx, int offsety) {
+shapeObj* msOffsetPolyline(shapeObj *p, double offsetx, double offsety) {
int i, j, first,idx;
double ox=0, oy=0, limit;
double dx,dy,dx0=0, dy0=0,x, y, x0=0.0, y0=0.0, k=0.0, k0=0.0, q=0.0, q0=0.0;
More information about the mapserver-commits
mailing list