Changeset 31127 in osm for applications


Ignore:
Timestamp:
2015-05-14T21:39:55+02:00 (10 years ago)
Author:
stoecker
Message:

fix #josm11419 - High DPI tiles

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r31077 r31127  
    585585                        }
    586586                        if (tile != null) {
    587                             tile.paint(g, posx, posy);
     587                            tile.paint(g, posx, posy, tilesize, tilesize);
    588588                            if (tileGridVisible) {
    589589                                g.drawRect(posx, posy, tilesize, tilesize);
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java

    r31122 r31127  
    220220    }
    221221
     222    /**
     223     * Paints the tile-image on the {@link Graphics} <code>g</code> at the
     224     * position <code>x</code>/<code>y</code>.
     225     *
     226     * @param g the Graphics object
     227     * @param x x-coordinate in <code>g</code>
     228     * @param y y-coordinate in <code>g</code>
     229     * @param width width that tile should have
     230     * @param height height that tile should have
     231     */
     232    public void paint(Graphics g, int x, int y, int width, int height) {
     233        if (image == null)
     234            return;
     235        g.drawImage(image, x, y, width, height, null);
     236    }
     237
     238
    222239    @Override
    223240    public String toString() {
Note: See TracChangeset for help on using the changeset viewer.