Changeset 17986 in josm for trunk/src/org


Ignore:
Timestamp:
2021-07-10T22:12:33+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20994 - OOBE when removing node of highlighted way (patch by Bjoeni)

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
2 edited

Legend:

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

    r17902 r17986  
    2323
    2424    /**
    25      * The way.
     25     * Returns the way.
     26     * @return the way
    2627     */
    2728    public W getWay() {
     
    3031
    3132    /**
    32      * The index of the first of the 2 nodes in the way.
     33     * Returns the index of the first of the 2 nodes in the way.
     34     * @return index of the first of the 2 nodes in the way
    3335     * @see #getUpperIndex()
    3436     * @see #getFirstNode()
     
    3941
    4042    /**
    41      * The index of the second of the 2 nodes in the way.
     43     * Returns the index of the second of the 2 nodes in the way.
     44     * @return the index of the second of the 2 nodes in the way
    4245     * @see #getLowerIndex()
    4346     * @see #getSecondNode()
     
    6265
    6366    /**
     67     * Determines if the segment is usable (node not deleted).
     68     * @return {@code true} if the segment is usable
     69     * @since 17986
     70     */
     71    public boolean isUsable() {
     72        return getUpperIndex() < way.getNodesCount();
     73    }
     74
     75    /**
    6476     * Returns the first node of the way segment.
    6577     * @return the first node
     
    7991    /**
    8092     * Determines and returns the way segment for the given way and node pair.
     93     * @param <N> type of node
     94     * @param <W> type of way
    8195     * @param way way
    8296     * @param first first node
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r17896 r17986  
    12911291            MapViewPath highlightSegs = null;
    12921292            for (WaySegment ws : highlightWaySegments) {
    1293                 if (ws.getWay() != way || ws.getLowerIndex() < offset) {
     1293                if (ws.getWay() != way || ws.getLowerIndex() < offset || !ws.isUsable()) {
    12941294                    continue;
    12951295                }
Note: See TracChangeset for help on using the changeset viewer.