Changeset 16465 in josm


Ignore:
Timestamp:
2020-05-19T09:42:07+02:00 (4 years ago)
Author:
GerdP
Message:

simplify code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r16460 r16465  
    7272        }
    7373
    74         public void prepare(PrimitiveId pid) {
     74        void prepare(PrimitiveId pid) {
    7575            zoomToNodeAction.setPrimitiveId(pid);
    7676            zoomToNodeAction.updateEnabledState();
     
    9898                return;
    9999            IPrimitive p = getPrimitiveToZoom();
    100             if (p != null) {
    101                 OsmData<?, ?, ?, ?> ds = MainApplication.getLayerManager().getActiveData();
    102                 if (ds != null) {
    103                     ds.setSelected(p.getPrimitiveId());
    104                     AutoScaleAction.autoScale(AutoScaleMode.SELECTION);
    105                 }
     100            if (p != null && p.isSelectable()) {
     101                p.getDataSet().setSelected(p);
     102                AutoScaleAction.autoScale(AutoScaleMode.SELECTION);
    106103            }
    107104        }
Note: See TracChangeset for help on using the changeset viewer.