Ticket #1954: FixCrashBug.patch
File FixCrashBug.patch, 1.4 KB (added by , 16 years ago) |
---|
-
src/wmsplugin/GeorefImage.java
52 52 EastNorth ma = new EastNorth(max.east()+dx, max.north()+dy); 53 53 Point minPt = nc.getPoint(mi), maxPt = nc.getPoint(ma); 54 54 55 // downloadAndPaintVisible in WMSLayer.java requests visible images only56 // so this path is never hit.57 55 /* 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))) { 59 57 return false; 60 } */58 } 61 59 62 60 // Width and height flicker about 2 pixels due to rounding errors, typically only 1 63 61 int width = Math.abs(maxPt.x-minPt.x); … … 65 63 int diffx = reImgHash.width - width; 66 64 int diffy = reImgHash.height - height; 67 65 66 // This happens if you zoom outside the world 67 if(width == 0 || height == 0) 68 return false; 69 68 70 // We still need to re-render if the requested size is larger (otherwise we'll have black lines) 69 71 // If it's only up to two pixels smaller, just draw the old image, the errors are minimal 70 72 // but the performance improvements when moving are huge