Changeset 3118 in josm for trunk


Ignore:
Timestamp:
2010-03-11T21:20:58+01:00 (10 years ago)
Author:
jttt
Message:

Handle changes in viewID in MapView instead of OsmDataLayer

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

Legend:

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

    r3116 r3118  
    182182    // Layers that wasn't changed since last paint
    183183    private final List<Layer> nonChangedLayers = new ArrayList<Layer>();
     184    private int lastViewID;
    184185
    185186    public MapView() {
     
    471472        }
    472473
    473         boolean canUseBuffer = nonChangedLayers.size() <= nonChangedLayersCount;
     474        boolean canUseBuffer = nonChangedLayers.size() <= nonChangedLayersCount && lastViewID == getViewID();
    474475        if (canUseBuffer) {
    475476            for (int i=0; i<nonChangedLayers.size(); i++) {
     
    509510            nonChangedLayers.add(visibleLayers.get(i));
    510511        }
     512        lastViewID = getViewID();
    511513
    512514        tempG.drawImage(offscreenBuffer, 0, 0, null);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r3116 r3118  
    9191    private boolean isChanged = true;
    9292    private int highlightUpdateCount;
    93     private int viewId;
    9493
    9594    protected void setRequiresSaveToFile(boolean newValue) {
     
    226225        isChanged = false;
    227226        highlightUpdateCount = data.getHighlightUpdateCount();
    228         viewId = Main.map.mapView.getViewID();
    229227
    230228        boolean active = mv.getActiveLayer() == this;
     
    726724    @Override
    727725    public boolean isChanged() {
    728         return isChanged || highlightUpdateCount != data.getHighlightUpdateCount() || viewId != Main.map.mapView.getViewID();
     726        return isChanged || highlightUpdateCount != data.getHighlightUpdateCount();
    729727    }
    730728
Note: See TracChangeset for help on using the changeset viewer.