Changeset 11079 in josm


Ignore:
Timestamp:
2016-10-05T01:26:43+02:00 (8 years ago)
Author:
michael2402
Message:

Fix #13665: A way is only selectable if it is drawable.

File:
1 edited

Legend:

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

    r11065 r11079  
    497497    /**
    498498     * Determines if this object is selectable.
     499     * <p>
     500     * A primitive can be selected if all conditions are met:
     501     * <ul>
     502     * <li>it is drawable
     503     * <li>it is not disabled (greyed out) by a filter.
     504     * </ul>
    499505     * @return {@code true} if this object is selectable
    500506     */
    501507    public boolean isSelectable() {
    502         return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_DISABLED + FLAG_HIDE_IF_DISABLED)) == 0;
     508        // not synchronized -> check disabled twice just to be sure we did not have a race condition.
     509        return !isDisabled() && isDrawable() && !isDisabled();
    503510    }
    504511
    505512    /**
    506513     * Determines if this object is drawable.
     514     * <p>
     515     * A primitive is complete if all conditions are met:
     516     * <ul>
     517     * <li>type and id is known
     518     * <li>tags are known
     519     * <li>it is not deleted
     520     * <li>it is not hidden by a filter
     521     * <li>for nodes: lat/lon are known
     522     * <li>for ways: all nodes are known and complete
     523     * <li>for relations: all members are known and complete
     524     * </ul>
    507525     * @return {@code true} if this object is drawable
    508526     */
Note: See TracChangeset for help on using the changeset viewer.