Ignore:
Timestamp:
2019-05-03T15:27:07+02:00 (7 years ago)
Author:
Don-vip
Message:

performance - avoid to create the same EastNorth instances during mapview rendering

File:
1 edited

Legend:

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

    r14607 r15041  
    684684        }
    685685
    686         if (getCenter() == null)
     686        EastNorth oldCenter = getCenter();
     687        if (oldCenter == null)
    687688            return false; // no data loaded yet.
    688689
     
    691692            Point l1 = getLocationOnScreen();
    692693            final EastNorth newCenter = new EastNorth(
    693                     getCenter().getX()+ (l1.x-oldLoc.x - (oldSize.width-getWidth())/2.0)*getScale(),
    694                     getCenter().getY()+ (oldLoc.y-l1.y + (oldSize.height-getHeight())/2.0)*getScale()
     694                    oldCenter.getX()+ (l1.x-oldLoc.x - (oldSize.width-getWidth())/2.0)*getScale(),
     695                    oldCenter.getY()+ (oldLoc.y-l1.y + (oldSize.height-getHeight())/2.0)*getScale()
    695696                    );
    696697            oldLoc = null; oldSize = null;
Note: See TracChangeset for help on using the changeset viewer.