Changeset 4649 in josm for trunk/src/org
- Timestamp:
- 2011-12-10T16:56:02+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r4639 r4649 336 336 private final List<PolyData> outerPolygons = new ArrayList<PolyData>(); 337 337 private final List<PolyData> combinedPolygons = new ArrayList<PolyData>(); 338 339 private boolean incomplete; 338 340 339 341 public Multipolygon(Relation r) { … … 346 348 // Fill inner and outer list with valid ways 347 349 for (RelationMember m : r.getMembers()) { 348 if (m.getMember().isDrawable()) { 350 if (m.getMember().isIncomplete()) { 351 this.incomplete = true; 352 } else if (m.getMember().isDrawable()) { 349 353 if (m.isWay()) { 350 354 Way w = m.getWay(); … … 370 374 addInnerToOuters(); 371 375 } 376 } 377 378 public final boolean isIncomplete() { 379 return incomplete; 372 380 } 373 381 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java
r4636 r4649 229 229 @Override 230 230 public void dataChanged(DataChangedEvent event) { 231 // Do nothing 231 // Do not call updateMultipolygonsReferringTo as getPrimitives() 232 // can return all the data set primitives for this event 233 Collection<Map<Relation, Multipolygon>> maps = null; 234 for (OsmPrimitive p : event.getPrimitives()) { 235 if (isMultipolygon(p)) { 236 if (maps == null) { 237 maps = getMapsFor(event.getDataset()); 238 } 239 for (Map<Relation, Multipolygon> map : maps) { 240 Multipolygon mp = map.get(p); 241 // DataChangedEvent is sent after downloading incomplete members, 242 // without having received RelationMembersChangedEvent or PrimitivesAddedEvent 243 if (mp != null && mp.isIncomplete()) { 244 // This ensures previously incomplete multipolygons will be correctly redrawn 245 map.remove(p); 246 } 247 } 248 } 249 } 232 250 } 233 251
Note:
See TracChangeset
for help on using the changeset viewer.