Ticket #1954: FixCrashBug.patch

File FixCrashBug.patch, 1.4 KB (added by xeen, 16 years ago)
  • src/wmsplugin/GeorefImage.java

     
    5252        EastNorth ma = new EastNorth(max.east()+dx, max.north()+dy);
    5353        Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma);
    5454
    55         // downloadAndPaintVisible in WMSLayer.java requests visible images only
    56         // so this path is never hit.
    5755        /* this is isVisible() but taking dx, dy into account */
    58         /*if(!(g.hitClip(minPt.x, maxPt.y, maxPt.x - minPt.x, minPt.y - maxPt.y))) {
     56        if(!(g.hitClip(minPt.x, maxPt.y, maxPt.x - minPt.x, minPt.y - maxPt.y))) {
    5957            return false;
    60         }*/
     58        }
    6159       
    6260        // Width and height flicker about 2 pixels due to rounding errors, typically only 1
    6361        int width = Math.abs(maxPt.x-minPt.x);
     
    6563        int diffx = reImgHash.width - width;
    6664        int diffy = reImgHash.height - height;
    6765       
     66        // This happens if you zoom outside the world
     67        if(width == 0 || height == 0)
     68            return false;
     69       
    6870        // We still need to re-render if the requested size is larger (otherwise we'll have black lines)
    6971        // If it's only up to two pixels smaller, just draw the old image, the errors are minimal
    7072        // but the performance improvements when moving are huge