Changeset 7486 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r7290 r7486 148 148 @Override 149 149 public void visit(Way w) { 150 if (!w.isArea() && ElemStyles.has AreaElemStyle(w, false)) {150 if (!w.isArea() && ElemStyles.hasOnlyAreaElemStyle(w)) { 151 151 List<Node> nodes = w.getNodes(); 152 152 if (nodes.size()<1) return; // fix zero nodes bug -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r7448 r7486 472 472 return getAreaElemStyle(p, pretendWayIsClosed) != null; 473 473 } 474 475 /** 476 * Determines whether primitive has <b>only</b> an AreaElemStyle. 477 * @param p the OSM primitive 478 * @return {@code true} if primitive has only an AreaElemStyle 479 * @since 7486 480 */ 481 public static boolean hasOnlyAreaElemStyle(OsmPrimitive p) { 482 MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock(); 483 try { 484 if (MapPaintStyles.getStyles() == null) 485 return false; 486 StyleList styles = MapPaintStyles.getStyles().generateStyles(p, 1.0, null, false).a; 487 if (styles.isEmpty()) { 488 return false; 489 } 490 for (ElemStyle s : styles) { 491 if (!(s instanceof AreaElemStyle)) { 492 return false; 493 } 494 } 495 return true; 496 } finally { 497 MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock(); 498 } 499 } 474 500 }
Note:
See TracChangeset
for help on using the changeset viewer.