Changeset 33456 in osm for applications/editors


Ignore:
Timestamp:
2017-07-18T13:39:32+02:00 (7 years ago)
Author:
giackserva
Message:

[pt_assistant] #josm14904 - auto zoom to selected edge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/EdgeSelectionAction.java

    r33455 r33456  
    1414
    1515import org.openstreetmap.josm.Main;
     16import org.openstreetmap.josm.actions.AutoScaleAction;
    1617import org.openstreetmap.josm.actions.mapmode.MapMode;
    1718import org.openstreetmap.josm.data.osm.DataSet;
     
    139140        Way initial = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive::isUsable);
    140141        if (initial != null) {
    141             ds.setSelected(getEdgeFromWay(initial, getModeOfTravel()));
     142            List<Way> edge = getEdgeFromWay(initial, getModeOfTravel());
     143            ds.setSelected(edge);
     144            AutoScaleAction.zoomTo(
     145                    edge.stream()
     146                    .map(w -> (OsmPrimitive) w)
     147                    .collect(Collectors.toList()));
    142148        } else
    143149            ds.clearSelection();
Note: See TracChangeset for help on using the changeset viewer.