Changeset 1728 in josm for trunk


Ignore:
Timestamp:
2009-07-04T14:04:08+02:00 (15 years ago)
Author:
stoecker
Message:

fixed #2804 - move mode not working

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r1722 r1728  
    6969        for (Node n : this.objects) {
    7070            OldState os = new OldState();
    71             os.latlon = n.getCoor();
     71            os.latlon = new LatLon(n.getCoor());
    7272            os.modified = n.modified;
    7373            oldState.add(os);
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r1722 r1728  
    7575        for (Node n : this.objects) {
    7676            OldState os = new OldState();
    77             os.latlon = n.getCoor();
     77            os.latlon = new LatLon(n.getCoor());
    7878            os.eastNorth = n.getEastNorth();
    7979            os.modified = n.modified;
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r1724 r1728  
    2525    public final void setEastNorth(EastNorth eastNorth) {
    2626        proj = Main.proj;
    27         eastNorth = eastNorth;
     27        this.eastNorth = eastNorth;
    2828        LatLon l = proj.eastNorth2latlon(eastNorth);
    29         setLocation(l.lat(), l.lon());
     29        setLocation(l.lon(), l.lat());
    3030    }
    3131
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r1724 r1728  
    4747    public LatLon(double lat, double lon) {
    4848        super(lon, lat);
     49    }
     50
     51    public LatLon(LatLon coor) {
     52        super(coor.lon(), coor.lat());
    4953    }
    5054
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r1725 r1728  
    8585            return (circum < 1500);
    8686
    87         /* formula to calculate a map scale: natural size / map size = scale
    88            example: 876000mm (876m as displayed) / 22mm (roughly estimated screen size of legend bar) = 39818
    89 
    90            so the exact "correcting value" below depends only on the screen size and resolution
    91            XXX - do we need a Preference setting for this (if things vary widely)? */
    92         return !(circum >= e.maxScale / 22 || circum < e.minScale / 22);
     87        return !(circum >= e.maxScale || circum < e.minScale);
    9388    }
    9489
     
    12741269        useRealWidth = Main.pref.getBoolean("mappaint.useRealWidth",false);
    12751270        zoomLevelDisplay = Main.pref.getBoolean("mappaint.zoomLevelDisplay",false);
    1276         circum = Main.map.mapView.getMapScale();
     1271        circum = Main.map.mapView.getDist100Pixel();
    12771272        styles = MapPaintStyles.getStyles().getStyleSet();
    12781273        drawMultipolygon = Main.pref.getBoolean("mappaint.multipolygon",true);
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r1725 r1728  
    7070        id.update(x.getBytes());
    7171        return new Long(id.getValue()).intValue();
    72     }
    73 
    74     public double getMapScale() {
    75         /* TODO: we assume a pixel is 0.025mm */
    76         return getDist100Pixel()/(0.00025*100);
    7772    }
    7873
Note: See TracChangeset for help on using the changeset viewer.