Ignore:
Timestamp:
2017-04-09T13:52:57+02:00 (7 years ago)
Author:
Don-vip
Message:

see #7427 - checkstyle

File:
1 edited

Legend:

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

    r11858 r11860  
    1818/**
    1919 * Tile class that stores a reprojected version of the original tile.
     20 * @since 11858
    2021 */
    2122public class ReprojectionTile extends Tile {
     
    2526    protected boolean maxZoomReached;
    2627
     28    /**
     29     * Constructs a new {@code ReprojectionTile}.
     30     * @param source sourec tile
     31     * @param xtile X coordinate
     32     * @param ytile Y coordinate
     33     * @param zoom zoom level
     34     */
    2735    public ReprojectionTile(TileSource source, int xtile, int ytile, int zoom) {
    2836        super(source, xtile, ytile, zoom);
     
    5058        return true;
    5159    }
    52    
     60
    5361    @Override
    5462    public void setImage(BufferedImage image) {
     
    100108        Dimension dim = getDimension(pbTargetAligned, scaleMapView);
    101109        Integer scaleFix = limitScale(source.getTileSize(), Math.sqrt(dim.getWidth() * dim.getHeight()));
    102         double scale = scaleFix == null ? scaleMapView : scaleMapView * scaleFix;
     110        double scale = scaleFix == null ? scaleMapView : (scaleMapView * scaleFix);
    103111
    104112        ImageWarp.PointTransform pointTransform = pt -> {
     
    153161     */
    154162    protected Integer limitScale(double lenOrig, double lenNow) {
    155         double LIMIT = 3;
    156         if (lenNow > LIMIT * lenOrig) {
    157             int n = (int) Math.ceil((Math.log(lenNow) - Math.log(LIMIT * lenOrig)) / Math.log(2));
     163        final double limit = 3;
     164        if (lenNow > limit * lenOrig) {
     165            int n = (int) Math.ceil((Math.log(lenNow) - Math.log(limit * lenOrig)) / Math.log(2));
    158166            int f = 1 << n;
    159167            double lenNowFixed = lenNow / f;
    160             if (!(lenNowFixed <= LIMIT * lenOrig)) throw new AssertionError();
    161             if (!(lenNowFixed > LIMIT * lenOrig / 2)) throw new AssertionError();
     168            if (lenNowFixed > limit * lenOrig) throw new AssertionError();
     169            if (lenNowFixed <= limit * lenOrig / 2) throw new AssertionError();
    162170            return f;
    163171        }
    164         if (lenNow > LIMIT * lenOrig / 2)
     172        if (lenNow > limit * lenOrig / 2)
    165173            return 1;
    166174        return null;
Note: See TracChangeset for help on using the changeset viewer.