Changeset 9183 in josm for trunk/src/org


Ignore:
Timestamp:
2015-12-27T23:30:14+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #12239 - filtered multipolygon relations could be selected by double-clicking and ways by middle-clicking

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java

    r8393 r9183  
    4949        }
    5050        for (Relation r : ds.getRelations()) {
    51             if (r.isUsable() && r.isMultipolygon()) {
     51            if (r.isUsable() && r.isMultipolygon() && r.isSelectable()) {
    5252                if (Geometry.isNodeInsideMultiPolygon(n, r, null)) {
    5353                    for (RelationMember m : r.getMembers()) {
     
    6868        return found.values();
    6969    }
    70 
    7170
    7271    /**
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r9078 r9183  
    22package org.openstreetmap.josm.gui;
    33
     4import static org.openstreetmap.josm.data.osm.OsmPrimitive.isSelectablePredicate;
     5import static org.openstreetmap.josm.data.osm.OsmPrimitive.isUsablePredicate;
    46import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    57import static org.openstreetmap.josm.tools.I18n.marktr;
     
    7375import org.openstreetmap.josm.tools.GBC;
    7476import org.openstreetmap.josm.tools.ImageProvider;
     77import org.openstreetmap.josm.tools.Predicate;
    7578
    7679/**
     
    285288                    // display them if the middle mouse button is pressed and keep them until the mouse is moved
    286289                    if (middleMouseDown || isAtOldPosition) {
    287                         Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos, OsmPrimitive.isUsablePredicate);
     290                        Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos, new Predicate<OsmPrimitive>() {
     291                            @Override
     292                            public boolean evaluate(OsmPrimitive o) {
     293                                return isUsablePredicate.evaluate(o) && isSelectablePredicate.evaluate(o);
     294                            }
     295                        });
    288296
    289297                        final JPanel c = new JPanel(new GridBagLayout());
     
    432440         */
    433441        private void statusBarElementUpdate(MouseState ms) {
    434             final OsmPrimitive osmNearest = mv.getNearestNodeOrWay(ms.mousePos, OsmPrimitive.isUsablePredicate, false);
     442            final OsmPrimitive osmNearest = mv.getNearestNodeOrWay(ms.mousePos, isUsablePredicate, false);
    435443            if (osmNearest != null) {
    436444                nameText.setText(osmNearest.getDisplayName(DefaultNameFormatter.getInstance()));
Note: See TracChangeset for help on using the changeset viewer.