Ignore:
Timestamp:
2011-02-01T01:49:32+01:00 (13 years ago)
Author:
framm
Message:

new viewport following function; moves the viewport so that the last placed
node is in the center. the idea is to greatly improve tracing of long, linear
features from imagery or tracks (no need to right-click and pan all the time),
however the execution still leaves to be desired; problem is that after you
have placed a node you have to wait for the movement to finish before you can
place the next node. possible enhancements: only scroll if placed node is on
the outer rim of viewport?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r1724 r3837  
    3434    public EastNorth getCenter(EastNorth en2) {
    3535        return new EastNorth((this.x + en2.x)/2.0, (this.y + en2.y)/2.0);
     36    }
     37
     38    public double distance(EastNorth en2) {
     39        return Math.sqrt((this.x-en2.x)*(this.x-en2.x) + (this.y-en2.y)*(this.y-en2.y));
    3640    }
    3741
Note: See TracChangeset for help on using the changeset viewer.