Ignore:
Timestamp:
2010-11-14T17:54:23+01:00 (14 years ago)
Author:
bastiK
Message:

applied #5627 (patch by bilbo) - Speedup of node drawing

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java

    r3329 r3653  
    111111    public void drawNode(Node n) {
    112112        /* check, if the node is visible at all */
    113         if((n.getEastNorth().east()  > maxEN.east() ) ||
    114                 (n.getEastNorth().north() > maxEN.north()) ||
    115                 (n.getEastNorth().east()  < minEN.east() ) ||
    116                 (n.getEastNorth().north() < minEN.north()))
     113        EastNorth en = n.getEastNorth();
     114        if((en.east()  > maxEN.east() ) ||
     115                (en.north() > maxEN.north()) ||
     116                (en.east()  < minEN.east() ) ||
     117                (en.north() < minEN.north()))
    117118            return;
    118119
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r3565 r3653  
    216216    public void drawNode(Node n, Color color, int size, boolean fill, String name) {
    217217        if (size > 1) {
     218            Point p = nc.getPoint(n);
     219            if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
    218220            int radius = size / 2;
    219             Point p = nc.getPoint(n);
    220             if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth())
    221                     || (p.y > nc.getHeight()))
    222                 return;
    223221
    224222            if (inactive || n.isDisabled()) {
     
    228226            }
    229227            if (fill) {
    230                 g.fillRect(p.x - radius, p.y - radius, size, size);
    231                 g.drawRect(p.x - radius, p.y - radius, size, size);
     228                g.fillRect(p.x - radius, p.y - radius, size + 1, size + 1);
    232229            } else {
    233230                g.drawRect(p.x - radius, p.y - radius, size, size);
Note: See TracChangeset for help on using the changeset viewer.