Ignore:
Timestamp:
2016-06-21T23:41:42+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13019 - Make commands trigger an implicit layer redraw (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

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

    r10413 r10452  
    148148     * Executes the command on the dataset. This implementation will remember all
    149149     * primitives returned by fillModifiedData for restoring them on undo.
     150     * <p>
     151     * The layer should be invalidated after execution so that it can be re-painted.
    150152     * @return true
     153     * @see #invalidateAffectedLayers()
    151154     */
    152155    public boolean executeCommand() {
     
    300303                Objects.equals(layer, command.layer);
    301304    }
     305
     306    /**
     307     * Invalidate all layers that were affected by this command.
     308     * @see Layer#invalidate()
     309     */
     310    public void invalidateAffectedLayers() {
     311        OsmDataLayer layer = getLayer();
     312        if (layer != null) {
     313            layer.invalidate();
     314        }
     315    }
    302316}
Note: See TracChangeset for help on using the changeset viewer.