Changeset 36188 in osm for applications/editors/josm/plugins
- Timestamp:
- 2023-10-31T17:55:32+01:00 (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java
r35978 r36188 2 2 package org.openstreetmap.josm.plugins.photoadjust; 3 3 4 import java.awt.event.InputEvent; 4 5 import java.awt.event.MouseEvent; 5 6 import java.util.List; … … 26 27 // the photo is moved very far. 27 28 private EastNorth dragOffset; 28 private boolean centerViewIsDisabled = false;29 private boolean centerViewNeedsEnable = false;29 private boolean centerViewIsDisabled; 30 private boolean centerViewNeedsEnable; 30 31 31 32 /** … … 82 83 // Check if modifier key is pressed and change to 83 84 // image viewer photo if it is. 84 final boolean isAlt = (evt.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) == MouseEvent.ALT_DOWN_MASK;85 final boolean isCtrl = (evt.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == MouseEvent.CTRL_DOWN_MASK;86 final boolean isShift = (evt.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == MouseEvent.SHIFT_DOWN_MASK;85 final boolean isAlt = (evt.getModifiersEx() & InputEvent.ALT_DOWN_MASK) == InputEvent.ALT_DOWN_MASK; 86 final boolean isCtrl = (evt.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) == InputEvent.CTRL_DOWN_MASK; 87 final boolean isShift = (evt.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK; 87 88 // ignore key press with shift, to not conflict with selection 88 89 if (isShift) { … … 112 113 changeDirection(img, layer.getImageData(), evt); 113 114 } 114 } else if (isCtrl && isAlt) {115 } else if (isCtrl) { 115 116 movePhoto(img, layer.getImageData(), evt); 116 117 } … … 155 156 public void doMouseDragged(MouseEvent evt) { 156 157 if (dragData != null && dragPhoto != null) { 157 if ((evt.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == MouseEvent.CTRL_DOWN_MASK) {158 if ((evt.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) == InputEvent.CTRL_DOWN_MASK) { 158 159 if (dragData.isImageSelected(dragPhoto)) { 159 160 for (ImageEntry photo: dragData.getSelectedImages()) { … … 200 201 * @param evt Mouse event from one of the mouse adapters. 201 202 */ 202 private void movePhoto(ImageEntry photo, ImageData data, MouseEvent evt) {203 private static void movePhoto(ImageEntry photo, ImageData data, MouseEvent evt) { 203 204 LatLon newPos = MainApplication.getMap().mapView.getLatLon(evt.getX(), evt.getY()); 204 205 data.updateImagePosition(photo, newPos); … … 214 215 final EastNorth newPosEN = startEN.add(translation); 215 216 final LatLon newPos = MainApplication.getMap().mapView.getProjection().eastNorth2latlon(newPosEN); 216 photo.setPos(newPos); 217 photo.flagNewGpsData(); 217 dragData.updateImagePosition(photo, newPos); 218 218 } 219 219
Note:
See TracChangeset
for help on using the changeset viewer.