Changeset 1250 in josm


Ignore:
Timestamp:
11.01.2009 18:43:37 (3 years ago)
Author:
ulfl
Message:

isPolygonVisible() shouldn't return true, if width and height are both 0

This indicates we have a way with no nodes in it. Hmmm, happens often in reality, but under which circumstances does this happen? (bug?)

File:
1 edited

Legend:

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

    r1236 r1250  
    360360    protected boolean isPolygonVisible(Polygon polygon) { 
    361361        Rectangle bounds = polygon.getBounds(); 
     362        if (bounds.width == 0 && bounds.height == 0) return false; 
    362363        if (bounds.x > nc.getWidth()) return false; 
    363         else if (bounds.y > nc.getHeight()) return false; 
    364         else if (bounds.x + bounds.width < 0) return false; 
    365         else if (bounds.y + bounds.height < 0) return false; 
    366  
     364        if (bounds.y > nc.getHeight()) return false; 
     365        if (bounds.x + bounds.width < 0) return false; 
     366        if (bounds.y + bounds.height < 0) return false; 
    367367        return true; 
    368368    } 
Note: See TracChangeset for help on using the changeset viewer.