Changeset 7579

Show
Ignore:
Timestamp:
05/12/08 13:26:36 (2 months ago)
Author:
tbonfort
Message:

AGG: allow dashed hatch symbols (#2614)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mapserver/HISTORY.TXT

    r7578 r7579  
    1313Current Version (5.1-dev, SVN trunk): 
    1414------------------------------------- 
     15- AGG: allow dashed hatch symbols (#2614) 
     16 
    1517- AGG: enable offset lines of type x -99 (#2588) 
    1618 
  • trunk/mapserver/mapagg.cpp

    r7578 r7579  
    17811781            hatch.transform(agg::trans_affine_translation(p->bounds.minx, p->bounds.miny)); 
    17821782             
    1783             agg::conv_stroke <agg::path_storage > stroke(hatch); 
    1784             stroke.width(style->width); 
    17851783             
    1786             //render the hatch clipped by the shape 
    1787             ren->renderPathSolidClipped(stroke,*polygons,agg_color); 
     1784             
     1785            if(symbol->patternlength>1) { 
     1786                //dash the hatch and render it clipped by the shape 
     1787                agg::conv_dash<agg::path_storage > dash(hatch); 
     1788                agg::conv_stroke<agg::conv_dash<agg::path_storage> > stroke_dash(dash);   
     1789                for (int i=0; i<symbol->patternlength; i+=2) { 
     1790                    if (i < symbol->patternlength-1) 
     1791                        dash.add_dash(symbol->pattern[i], symbol->pattern[i+1]); 
     1792                } 
     1793                stroke_dash.width(style->width); 
     1794                ren->renderPathSolidClipped(stroke_dash,*polygons,agg_color); 
     1795            } else { 
     1796                //render the hatch clipped by the shape 
     1797                agg::conv_stroke <agg::path_storage > stroke(hatch); 
     1798                stroke.width(style->width); 
     1799                ren->renderPathSolidClipped(stroke,*polygons,agg_color); 
     1800            } 
    17881801             
    17891802            //render the optional outline