Ticket #11419: 11419_highres_tiles_fix_display.patch

File 11419_highres_tiles_fix_display.patch, 1.7 KB (added by wiktorn, 9 years ago)
  • src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    diff --git src/org/openstreetmap/gui/jmapviewer/JMapViewer.java src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
    index 9ae171e..2e7d375 100644
    public class JMapViewer extends JPanel implements TileLoaderListener {  
    584584                            tile = tileController.getTile(tilex, tiley, zoom);
    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);
    590590                            }
  • src/org/openstreetmap/gui/jmapviewer/Tile.java

    diff --git src/org/openstreetmap/gui/jmapviewer/Tile.java src/org/openstreetmap/gui/jmapviewer/Tile.java
    index bfd1eaa..0021bdb 100644
    public class Tile {  
    219219        g.drawImage(image, x, y, null);
    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() {
    224241        return "Tile " + key;