[OpenMap Users] Matting paint in OMGraphic

From: Stéphane Wasserhardt <swasserhardt_at_cls.fr>
Date: Thu, 11 May 2006 11:45:17 +0200

Hello all !

Here is a new version of OMGraphic.render(Graphics) :

     public void render(Graphics g) {

         if (matted) {
             if (g instanceof Graphics2D && stroke instanceof BasicStroke) {
                 BasicStroke basicStroke = (BasicStroke) stroke;
                                 ((Graphics2D) g).setStroke(new BasicStroke(
                                                 basicStroke.getLineWidth()
+ 2f,
                                                 basicStroke.getEndCap(),
                                                 basicStroke.getLineJoin()
                                         ));
                 setGraphicsColor(g, mattingPaint);
                 draw(g);
             }
         }

         if (shouldRenderFill()) {
             setGraphicsForFill(g);
             fill(g);

             if (textureMask != null && textureMask != fillPaint) {
                 setGraphicsColor(g, textureMask);
                 fill(g);
             }
         }

         if (shouldRenderEdge()) {
             setGraphicsForEdge(g);
             draw(g);
         }

         renderLabel(g);
     }

The only modification is that matting paint now uses the stroke's "EndCap"
and "LineJoin" values. It is a small improvement, but it is an improvement :)

I hope it will be included in the next OpenMap release !

Stephane

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu May 11 2006 - 05:47:06 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT