Changeset 2808 in osm


Ignore:
Timestamp:
2007-05-07T00:43:02+02:00 (18 years ago)
Author:
damians
Message:

fixed stroke bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java

    r2807 r2808  
    181181                if (ls.shown) return;
    182182                ls.shown=true;
     183                Point p1 = nc.getPoint(ls.from.eastNorth);
     184                Point p2 = nc.getPoint(ls.to.eastNorth);
     185                // checking if this segment is visible
     186                if ((p1.x < 0) && (p2.x < 0)) return ;
     187                if ((p1.y < 0) && (p2.y < 0)) return ;
     188                if ((p1.x > nc.getWidth()) && (p2.x > nc.getWidth())) return ;
     189                if ((p1.y > nc.getHeight()) && (p2.y > nc.getHeight())) return ;
    183190                Graphics2D g2d = (Graphics2D)g;
    184191                if (ls.incomplete)
     
    192199                else
    193200                        g2d.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
    194                         //g2d.setStroke(new BasicStroke(width));
    195 
    196                 Point p1 = nc.getPoint(ls.from.eastNorth);
    197                 Point p2 = nc.getPoint(ls.to.eastNorth);
    198                 // checking if this Point is visible
    199                 if ((p1.x < 0) && (p2.x < 0)) return ;
    200                 if ((p1.y < 0) && (p2.y < 0)) return ;
    201                 if ((p1.x > nc.getWidth()) && (p2.x > nc.getWidth())) return ;
    202                 if ((p1.y > nc.getHeight()) && (p2.y > nc.getHeight())) return ;
    203201
    204202                g.drawLine(p1.x, p1.y, p2.x, p2.y);
     
    209207            g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI)));
    210208                }
     209                g2d.setStroke(new BasicStroke(1));
    211210               
    212211        }
Note: See TracChangeset for help on using the changeset viewer.