Changeset 11891 in josm
- Timestamp:
- 2017-04-13T00:03:15+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11883 r11891 1444 1444 TileXY t1, t2; 1445 1445 if (coordinateConverter.requiresReprojection()) { 1446 Projection projCurrent = Main.getProjection();1447 1446 Projection projServer = Projections.getProjectionByCode(tileSource.getServerCRS()); 1448 bounds = new ProjectionBounds(1447 ProjectionBounds projBounds = new ProjectionBounds( 1449 1448 new EastNorth(coordinateConverter.shiftDisplayToServer(bounds.getMin())), 1450 1449 new EastNorth(coordinateConverter.shiftDisplayToServer(bounds.getMax()))); 1451 bounds= projServer.getEastNorthBoundsBox(bounds,projCurrent);1452 t1 = tileSource.projectedToTileXY(b ounds.getMin().toProjected(), zoom);1453 t2 = tileSource.projectedToTileXY(b ounds.getMax().toProjected(), zoom);1450 ProjectionBounds bbox = projServer.getEastNorthBoundsBox(projBounds, Main.getProjection()); 1451 t1 = tileSource.projectedToTileXY(bbox.getMin().toProjected(), zoom); 1452 t2 = tileSource.projectedToTileXY(bbox.getMax().toProjected(), zoom); 1454 1453 } else { 1455 1454 IProjected topLeftUnshifted = coordinateConverter.shiftDisplayToServer(bounds.getMin()); -
trunk/src/org/openstreetmap/josm/tools/ImageWarp.java
r11866 r11891 119 119 } 120 120 121 private static int clamp(int i, int max) { 122 if (i < 0) { 123 return 0; 124 } else if (i >= max) { 125 return max - 1; 126 } else { 127 return i; 128 } 129 } 130 121 131 private static Color getColor(int x, int y, BufferedImage img) { 122 132 // border strategy: continue with the color of the outermost pixel, 123 133 // but change alpha component to fully translucent 124 boolean transparent = false; 125 if (x < 0) { 126 x = 0; 127 transparent = true; 128 } else if (x >= img.getWidth()) { 129 x = img.getWidth() - 1; 130 transparent = true; 131 } 132 if (y < 0) { 133 y = 0; 134 transparent = true; 135 } else if (y >= img.getHeight()) { 136 y = img.getHeight() - 1; 137 transparent = true; 138 } 139 Color clr = new Color(img.getRGB(x, y)); 140 if (!transparent) 134 int a = clamp(x, img.getWidth()); 135 int b = clamp(y, img.getHeight()); 136 Color clr = new Color(img.getRGB(a, b)); 137 if (a == x && b == y) 141 138 return clr; 142 139 // keep color components, but set transparency to 0
Note:
See TracChangeset
for help on using the changeset viewer.