Changeset 33146 in osm for applications/editors
- Timestamp:
- 2017-02-15T11:42:23+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/RotatePictureAction.java
r32675 r33146 23 23 import static org.openstreetmap.josm.tools.I18n.tr; 24 24 25 import java.awt. event.InputEvent;25 import java.awt.Point; 26 26 import java.awt.event.MouseEvent; 27 import java.awt.geom.Point2D; 27 28 28 29 import org.openstreetmap.josm.Main; … … 47 48 @Override 48 49 protected void doAction(MouseEvent e) { 49 double factor; 50 if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0) { 51 factor = Main.pref.getDouble("piclayer.rotatefactors.high_precision", 100.0); 52 } else { 53 factor = Main.pref.getDouble("piclayer.rotatefactors.low_precision", 10.0); 54 } 55 currentLayer.rotatePictureBy((e.getY() - prevMousePoint.getY()) / factor); 50 Point2D center = new Point(Main.map.mapView.getWidth()/2, Main.map.mapView.getHeight()/2); 51 double alpha1 = Math.atan2(e.getY() - center.getY(), e.getX() - center.getX()); 52 double alpha0 = Math.atan2(prevMousePoint.getY() - center.getY(), prevMousePoint.getX() - center.getX()); 53 currentLayer.rotatePictureBy(alpha1 - alpha0); 56 54 } 57 55 }
Note:
See TracChangeset
for help on using the changeset viewer.