Ignore:
Timestamp:
2014-09-29T23:41:46+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10557 - node icon not updated properly after undoing/redoing addition of a way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddCommand.java

    r6881 r7587  
    1212import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1313import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     14import org.openstreetmap.josm.data.osm.Way;
    1415import org.openstreetmap.josm.gui.DefaultNameFormatter;
    1516import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    4849    }
    4950
     51    protected static final void checkNodeStyles(OsmPrimitive osm) {
     52        if (osm instanceof Way) {
     53            // Fix #10557 - node icon not updated after undoing/redoing addition of a way
     54            ((Way)osm).clearCachedNodeStyles();
     55        }
     56    }
     57
    5058    @Override
    5159    public boolean executeCommand() {
    5260        getLayer().data.addPrimitive(osm);
    5361        osm.setModified(true);
     62        checkNodeStyles(osm);
    5463        return true;
    5564    }
     
    5867    public void undoCommand() {
    5968        getLayer().data.removePrimitive(osm);
     69        checkNodeStyles(osm);
    6070    }
    6171
Note: See TracChangeset for help on using the changeset viewer.