Changeset 17561 in osm


Ignore:
Timestamp:
2009-09-09T17:05:43+02:00 (15 years ago)
Author:
petrdlouhy
Message:

fix of adjust action

Location:
applications/editors/josm/plugins/wmsplugin/src/wmsplugin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java

    r17556 r17561  
    3535    }
    3636
    37     /* this does not take dx and dy offset into account! */
    38     public boolean isVisible(NavigatableComponent nc) {
    39         Point minPt = nc.getPoint(min), maxPt = nc.getPoint(max);
     37    public boolean isVisible(NavigatableComponent nc, double dx, double dy) {
     38        EastNorth mi = new EastNorth(min.east()+dx, min.north()+dy);
     39        EastNorth ma = new EastNorth(max.east()+dx, max.north()+dy);
     40        Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma);
    4041        Graphics g = nc.getGraphics();
    4142
     
    5152        Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma);
    5253
    53         /* this is isVisible() but taking dx, dy into account */
    54         if(!(g.hitClip(minPt.x, maxPt.y, maxPt.x - minPt.x, minPt.y - maxPt.y))) {
     54        if(!isVisible(nc, dx, dy)){
    5555            return false;
    5656        }
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java

    r17407 r17561  
    6565            image.max = b.max;
    6666
    67             if(image.isVisible(mv)) { //don't download, if the image isn't visible already
     67            if(image.isVisible(mv, layer.getDx(), layer.getDy())) { //don't download, if the image isn't visible already
    6868                image.image = grab(url);
    6969                image.flushedResizedCachedInstance();
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java

    r17407 r17561  
    101101                        }
    102102                }
     103        }
     104
     105        public double getDx(){
     106                return dx;
     107        }
     108
     109        public double getDy(){
     110                return dy;
    103111        }
    104112
     
    207215                        return;
    208216                ProjectionBounds bounds = mv.getProjectionBounds();
    209                 int bminx= (int)Math.floor ((bounds.min.east() * pixelPerDegree ) / ImageSize );
    210                 int bminy= (int)Math.floor ((bounds.min.north() * pixelPerDegree ) / ImageSize );
    211                 int bmaxx= (int)Math.ceil  ((bounds.max.east() * pixelPerDegree ) / ImageSize );
    212                 int bmaxy= (int)Math.ceil  ((bounds.max.north() * pixelPerDegree ) / ImageSize );
     217                int bminx= (int)Math.floor (((bounds.min.east() - dx) * pixelPerDegree) / ImageSize );
     218                int bminy= (int)Math.floor (((bounds.min.north() - dy) * pixelPerDegree) / ImageSize );
     219                int bmaxx= (int)Math.ceil  (((bounds.max.east() - dx) * pixelPerDegree) / ImageSize );
     220                int bmaxy= (int)Math.ceil  (((bounds.max.north() - dy) * pixelPerDegree) / ImageSize );
    213221
    214222                if((bmaxx - bminx > dax) || (bmaxy - bminy > day)){
Note: See TracChangeset for help on using the changeset viewer.