Changeset 8153 in josm


Ignore:
Timestamp:
2015-03-26T17:07:39+01:00 (9 years ago)
Author:
stoecker
Message:

fix #11263 - displacement in TMS layers - fix by asdqweasd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r7999 r8153  
    935935        // And how many pixels into the image itself does that
    936936        // correlate to?
    937         int img_x_offset = (int)(screen_x_offset * imageXScaling);
    938         int img_y_offset = (int)(screen_y_offset * imageYScaling);
     937        int img_x_offset = (int)(screen_x_offset * imageXScaling + 0.5);
     938        int img_y_offset = (int)(screen_y_offset * imageYScaling + 0.5);
    939939        // Now calculate the other corner of the image that we need
    940940        // by scaling the 'target' rectangle's dimensions.
    941         int img_x_end   = img_x_offset + (int)(target.getWidth() * imageXScaling);
    942         int img_y_end   = img_y_offset + (int)(target.getHeight() * imageYScaling);
     941        int img_x_end = img_x_offset + (int)(target.getWidth() * imageXScaling + 0.5);
     942        int img_y_end = img_y_offset + (int)(target.getHeight() * imageYScaling + 0.5);
    943943
    944944        if (Main.isDebugEnabled()) {
Note: See TracChangeset for help on using the changeset viewer.