Changeset 19166 in josm


Ignore:
Timestamp:
2024-08-05T20:33:25+02:00 (4 months ago)
Author:
taylor.smock
Message:

Fix #23828: Very slow wireframe view with large data set

This occurred since we were drawing every object in every relation (including
nodes of ways) even if those objects were not in view. We fix that by only
drawing objects that are inside the current viewing area.

File:
1 edited

Legend:

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

    r18031 r19166  
    178178                }
    179179            }
     180            displaySegments();
    180181        }
    181182        displaySegments();
     
    352353        g.setColor(col);
    353354
     355        Bounds viewArea = mapState.getViewArea().getLatLonBoundsBox();
    354356        for (IRelationMember<?> m : r.getMembers()) {
    355357            if (m.getMember().isIncomplete() || !m.getMember().isDrawable()) {
     
    357359            }
    358360
    359             if (m.isNode()) {
     361            if (m.isNode() && viewArea.contains((INode) m.getMember())) {
    360362                MapViewPoint p = mapState.getPointFor((INode) m.getMember());
    361363                if (p.isInView()) {
     
    363365                }
    364366
    365             } else if (m.isWay()) {
     367            } else if (m.isWay() && viewArea.contains(m.getMember().getBBox())) {
    366368                GeneralPath path = new GeneralPath();
    367369
Note: See TracChangeset for help on using the changeset viewer.