Ignore:
Timestamp:
2011-11-15T23:00:51+01:00 (13 years ago)
Author:
kpastor
Message:

Prints more types of layers correctly now, tested with PicLayer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java

    r27046 r27066  
    4949import org.openstreetmap.josm.gui.layer.Layer;
    5050import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    51 import org.openstreetmap.josm.gui.layer.ImageryLayer;
    5251
    5352/**
     
    162161        List<Layer> visibleLayers = getVisibleLayersInZOrder();
    163162        for (Layer l : visibleLayers) {
    164             if (l instanceof ImageryLayer) {
    165                 try {
    166                     /* This statement may have all kinds of unwanted side effects
    167                      * but ImageryLayers heavily depend on Main.map.mapView. */
     163            try {
     164                if (! (l instanceof OsmDataLayer)) {
     165                    /* OsmDataLayer does not need this.*/
     166                   
     167                    /* This manipulations may have all kinds of unwanted side effects
     168                     * but many Layer implementations heavily depend on Main.map.mapView. */
    168169                    Main.map.mapView = this;
    169                     l.paint(g2d, this, box);
    170170                }
    171                 finally {
    172                     Main.map.mapView = mapView;
    173                 }
     171                l.paint(g2d, this, box);
    174172            }
    175             else {
    176                 l.paint(g2d, this, box);
     173            finally {
     174                Main.map.mapView = mapView;
    177175            }
    178176        }
Note: See TracChangeset for help on using the changeset viewer.