Changeset 15481 in josm
- Timestamp:
- 2019-10-29T14:44:30+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r15041 r15481 739 739 */ 740 740 public void smoothScrollTo(EastNorth newCenter) { 741 // FIXME make these configurable.742 final int fps = 20; // animation frames per second743 final int speed = 1500; // milliseconds for full-screen-width pan744 741 final EastNorth oldCenter = getCenter(); 745 742 if (!newCenter.equals(oldCenter)) { 743 final int fps = Config.getPref().getInt("smooth.scroll.fps", 20); // animation frames per second 744 final int speed = Config.getPref().getInt("smooth.scroll.speed", 1500); // milliseconds for full-screen-width pan 745 final int maxtime = Config.getPref().getInt("smooth.scroll.maxtime", 5000); // milliseconds maximum scroll time 746 746 final double distance = newCenter.distance(oldCenter) / getScale(); 747 747 final double milliseconds = distance / getWidth() * speed; 748 if (milliseconds > maxtime) { // prevent overlong scroll time, speed up if necessary 749 milliseconds = maxtime; 750 } 748 751 final double frames = milliseconds * fps / 1000; 749 752 final EastNorth finalNewCenter = newCenter; … … 753 756 public void run() { 754 757 for (int i = 0; i < frames; i++) { 755 // FIXME - not use zoom history here758 // FIXME - do not use zoom history here 756 759 zoomTo(oldCenter.interpolate(finalNewCenter, (i+1) / frames)); 757 760 try {
Note:
See TracChangeset
for help on using the changeset viewer.