Ignore:
Timestamp:
2016-09-05T23:50:16+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1226 - Method parameters, caught exceptions and foreach variables should not be reassigned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r10925 r10965  
    550550     * Zoom to the given coordinate and scale.
    551551     *
    552      * @param newCenter The center x-value (easting) to zoom to.
    553      * @param newScale The scale to use.
     552     * @param center The center x-value (easting) to zoom to.
     553     * @param scale The scale to use.
    554554     * @param initial true if this call initializes the viewport.
    555555     */
    556     public void zoomTo(EastNorth newCenter, double newScale, boolean initial) {
     556    public void zoomTo(EastNorth center, double scale, boolean initial) {
    557557        Bounds b = getProjection().getWorldBoundsLatLon();
    558558        ProjectionBounds pb = getProjection().getWorldBoundsBoxEastNorth();
     559        double newScale = scale;
    559560        int width = getWidth();
    560561        int height = getHeight();
    561562
    562563        // make sure, the center of the screen is within projection bounds
    563         double east = newCenter.east();
    564         double north = newCenter.north();
     564        double east = center.east();
     565        double north = center.north();
    565566        east = Math.max(east, pb.minEast);
    566567        east = Math.min(east, pb.maxEast);
    567568        north = Math.max(north, pb.minNorth);
    568569        north = Math.min(north, pb.maxNorth);
    569         newCenter = new EastNorth(east, north);
     570        EastNorth newCenter = new EastNorth(east, north);
    570571
    571572        // don't zoom out too much, the world bounds should be at least
Note: See TracChangeset for help on using the changeset viewer.