Changeset 3144 in josm for trunk


Ignore:
Timestamp:
2010-03-18T21:43:59+01:00 (10 years ago)
Author:
jttt
Message:

Fix #4740 Map view sometimes turns black

File:
1 edited

Legend:

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

    r3136 r3144  
    187187    private int lastViewID;
    188188    private boolean paintPreferencesChanged = true;
     189    private Rectangle lastClipBounds = new Rectangle();
    189190
    190191    public MapView() {
     
    477478        }
    478479
    479         boolean canUseBuffer = !paintPreferencesChanged && nonChangedLayers.size() <= nonChangedLayersCount && lastViewID == getViewID();
     480        boolean canUseBuffer = !paintPreferencesChanged && nonChangedLayers.size() <= nonChangedLayersCount &&
     481        lastViewID == getViewID() && lastClipBounds.contains(g.getClipBounds());
    480482        if (canUseBuffer) {
    481483            for (int i=0; i<nonChangedLayers.size(); i++) {
     
    524526        lastViewID = getViewID();
    525527        paintPreferencesChanged = false;
     528        lastClipBounds = g.getClipBounds();
    526529
    527530        tempG.drawImage(nonChangedLayersBuffer, 0, 0, null);
Note: See TracChangeset for help on using the changeset viewer.