Ignore:
Timestamp:
2013-08-20T18:29:49+02:00 (7 years ago)
Author:
bastiK
Message:

applied #8987 - immutable coordinates (patch by shinigami)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r6069 r6162  
    684684                Point p4 = mv.getPoint(newN2en);
    685685
    686                 EastNorth normalUnitVector = getNormalUniVector();
     686                Point2D normalUnitVector = getNormalUniVector();
    687687
    688688                if (mode == Mode.extrude || mode == Mode.create_new) {
     
    753753    }
    754754
    755     private EastNorth getNormalUniVector() {
    756         double fac = 1.0 / activeMoveDirection.en.distance(0,0);
     755    private Point2D getNormalUniVector() {
     756        double fac = 1.0 / activeMoveDirection.en.length();
    757757        // mult by factor to get unit vector.
    758         EastNorth normalUnitVector = new EastNorth(activeMoveDirection.en.getX() * fac, activeMoveDirection.en.getY() * fac);
     758        Point2D normalUnitVector = new Point2D.Double(activeMoveDirection.en.getX() * fac, activeMoveDirection.en.getY() * fac);
    759759
    760760        // Check to see if our new N1 is in a positive direction with respect to the normalUnitVector.
     
    762762        if (newN1en != null && ((newN1en.getX() > initialN1en.getX()) != (normalUnitVector.getX() > -0.0))) {
    763763            // If not, use a sign-flipped version of the normalUnitVector.
    764             normalUnitVector = new EastNorth(-normalUnitVector.getX(), -normalUnitVector.getY());
     764            normalUnitVector = new Point2D.Double(-normalUnitVector.getX(), -normalUnitVector.getY());
    765765        }
    766766
     
    771771    }
    772772
    773     private void drawAngleSymbol(Graphics2D g2, Point2D center, EastNorth normal, boolean mirror) {
     773    private void drawAngleSymbol(Graphics2D g2, Point2D center, Point2D normal, boolean mirror) {
    774774        // EastNorth units per pixel
    775775        double factor = 1.0/g2.getTransform().getScaleX();
Note: See TracChangeset for help on using the changeset viewer.