Changeset 12968 in josm


Ignore:
Timestamp:
2017-10-09T21:12:22+02:00 (7 years ago)
Author:
bastiK
Message:

see #15273 - fix backgroundColorCache invalidation

File:
1 edited

Legend:

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

    r12966 r12968  
    7979        styleSources = new ArrayList<>();
    8080        Config.getPref().addPreferenceChangeListener(this);
    81         MapPaintStyles.addMapPaintSylesUpdateListener(new MapPaintStyles.MapPaintSylesUpdateListener() {
    82             //TODO: Listen to wireframe map mode changes.
    83             @Override
    84             public void mapPaintStylesUpdated() {
    85                 backgroundColorCache = null;
    86             }
    87 
    88             @Override
    89             public void mapPaintStyleEntryUpdated(int idx) {
    90                 mapPaintStylesUpdated();
    91             }
    92         });
    9381    }
    9482
     
    482470    void clear() {
    483471        styleSources.clear();
     472        invalidate();
    484473    }
    485474
     
    490479    void add(StyleSource style) {
    491480        styleSources.add(style);
     481        invalidate();
    492482    }
    493483
     
    498488     */
    499489    boolean remove(StyleSource style) {
    500         return styleSources.remove(style);
     490        boolean result = styleSources.remove(style);
     491        invalidate();
     492        return result;
    501493    }
    502494
     
    508500        styleSources.clear();
    509501        styleSources.addAll(sources);
     502        invalidate();
     503    }
     504
     505    private void invalidate() {
     506        backgroundColorCache = null;
    510507    }
    511508
Note: See TracChangeset for help on using the changeset viewer.