Ignore:
Timestamp:
2011-01-23T17:13:30+01:00 (11 years ago)
Author:
jttt
Message:

wmslayer - when overlapping is enabled, keep (and cache) only visible part of image; center text in case of "not in cache" or "error"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java

    r3747 r3808  
    8888            g.setFont(tempFont);
    8989            g.setColor(Color.BLACK);
    90             g.drawString(tr("Not in cache"), 10, img.getHeight()/2);
     90            String text = tr("Not in cache");
     91            g.drawString(text, (img.getWidth() - g.getFontMetrics().stringWidth(text)) / 2, img.getHeight()/2);
    9192            g.setFont(font);
    9293            this.image = img;
     
    100101
    101102    private BufferedImage createImage() {
    102         return new BufferedImage(layer.getBaseImageWidth(), layer.getBaseImageHeight(), BufferedImage.TYPE_INT_RGB);
     103        return new BufferedImage(layer.getImageSize(), layer.getImageSize(), BufferedImage.TYPE_INT_RGB);
    103104    }
    104105
Note: See TracChangeset for help on using the changeset viewer.