Changeset 2432 in josm for trunk/src


Ignore:
Timestamp:
2009-11-10T21:22:18+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed patch applied in in r2429 - didn't compile. Hope the downcasting is fine.

File:
1 edited

Legend:

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

    r2429 r2432  
    1212import java.awt.Point;
    1313import java.awt.Rectangle;
     14import java.awt.event.ActionEvent;
    1415import java.awt.event.KeyEvent;
    1516import java.awt.event.MouseEvent;
    16 import java.awt.event.ActionEvent;
    1717import java.awt.geom.AffineTransform;
     18import java.awt.geom.GeneralPath;
     19import java.awt.geom.Line2D;
    1820import java.awt.geom.NoninvertibleTransformException;
    19 import java.awt.geom.GeneralPath;
    2021import java.awt.geom.Point2D;
    21 import java.awt.geom.Line2D;
    22 import java.awt.geom.Line2D.Double;
    23 import java.lang.Math;
    2422import java.util.Collection;
    2523import java.util.LinkedList;
     
    188186                // Better way of testing list equality non-order-sensitively?
    189187                if (c instanceof MoveCommand
    190                 && ((MoveCommand)c).getMovedNodes().contains(n1)
    191                 && ((MoveCommand)c).getMovedNodes().contains(n2)
    192                 && ((MoveCommand)c).getMovedNodes().size() == 2) {
     188                        && ((MoveCommand)c).getMovedNodes().contains(n1)
     189                        && ((MoveCommand)c).getMovedNodes().contains(n2)
     190                        && ((MoveCommand)c).getMovedNodes().size() == 2) {
    193191                    // MoveCommand doesn't let us know how much it has already moved the selection
    194192                    // so we have to do some ugly record-keeping.
     
    268266                    // Check to see if our new N1 is in a positive direction with respect to the normalUnitVector.
    269267                    // Even if the x component is zero, we should still be able to discern using +0.0 and -0.0
    270                     if (newN1en == null || (newN1en.getX() > initialN1en.getX() == normalUnitVector.getX() > -0.0))
     268                    if (newN1en == null || (newN1en.getX() > initialN1en.getX() == normalUnitVector.getX() > -0.0)) {
    271269                        drawnorm = normalUnitVector;
    272                     else
     270                    } else {
    273271                        // If not, use a sign-flipped version of the normalUnitVector.
    274272                        drawnorm = new EastNorth(-normalUnitVector.getX(), -normalUnitVector.getY());
     273                    }
    275274                    normline = createSemiInfiniteLine(centerpoint, drawnorm, g2);
    276275                    g2.draw(normline);
     
    286285                    Point2D ra2 = new Point2D.Double(ra1.getX()-raoffsety, ra1.getY()+raoffsetx);
    287286                    GeneralPath ra = new GeneralPath();
    288                     ra.moveTo(ra1.getX(), ra1.getY());
    289                     ra.lineTo(ra2.getX(), ra2.getY());
    290                     ra.lineTo(ra3.getX(), ra3.getY());
     287                    ra.moveTo((float)ra1.getX(), (float)ra1.getY());
     288                    ra.lineTo((float)ra2.getX(), (float)ra2.getY());
     289                    ra.lineTo((float)ra3.getX(), (float)ra3.getY());
    291290                    g2.draw(ra);
    292291                }
     
    353352            // based on that.
    354353            normalTransform = new AffineTransform(
    355                 r*normalUnitVector.getX()*normalUnitVector.getX(), compcoordcoeff,
    356                 compcoordcoeff, r*normalUnitVector.getY()*normalUnitVector.getY(),
    357                 initialN1en.getX()-(s*r*normalUnitVector.getX()), initialN1en.getY()+(s*r*normalUnitVector.getY()));
     354                    r*normalUnitVector.getX()*normalUnitVector.getX(), compcoordcoeff,
     355                    compcoordcoeff, r*normalUnitVector.getY()*normalUnitVector.getY(),
     356                    initialN1en.getX()-(s*r*normalUnitVector.getX()), initialN1en.getY()+(s*r*normalUnitVector.getY()));
    358357
    359358            // Switch mode.
Note: See TracChangeset for help on using the changeset viewer.