Changeset 11633 in josm


Ignore:
Timestamp:
2017-02-26T13:33:10+01:00 (2 years ago)
Author:
Don-vip
Message:

fix #10638 - fix zoom problem when validating "Way connected to Area" with a lot of data sources (patch by GerdP)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r11627 r11633  
    1717import java.awt.event.ActionEvent;
    1818import java.awt.geom.Area;
     19import java.awt.geom.Path2D;
    1920import java.awt.geom.Rectangle2D;
    2021import java.awt.image.BufferedImage;
     
    412413            // over-grow it just to be sure
    413414            b.grow(100, 100);
    414             Area a = new Area(b);
    415 
    416             // now successively subtract downloaded areas
     415            Path2D p = new Path2D.Double();
     416
     417            // combine successively downloaded areas
    417418            for (Bounds bounds : data.getDataSourceBounds()) {
    418419                if (bounds.isCollapsed()) {
    419420                    continue;
    420421                }
    421                 a.subtract(mv.getState().getArea(bounds));
    422             }
     422                p.append(mv.getState().getArea(bounds), false);
     423            }
     424            // subtract combined areas
     425            Area a = new Area(b);
     426            a.subtract(new Area(p));
    423427
    424428            // paint remainder
Note: See TracChangeset for help on using the changeset viewer.