Skip to content

Commit 386c102

Browse files
committed
fix: Simulator pinch zoom will now respond to shift-drag, since the previous right-click behaviour conflicts with the context/menu + inspect element feature.
1 parent d3f93db commit 386c102

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ public void mouseDragged(MouseEvent e) {
20222022
}
20232023

20242024
// right click dragging means a pinch to zoom
2025-
if (!releaseLock && (e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) {
2025+
if (!releaseLock && isPinchZoom(e)) {
20262026
int x = scaleCoordinateX(e.getX());
20272027
int y = scaleCoordinateY(e.getY());
20282028
if (mouseDown || (x >= 0 && x < getDisplayWidthImpl() && y >= 0 && y < getDisplayHeightImpl())) {
@@ -2033,6 +2033,11 @@ public void mouseDragged(MouseEvent e) {
20332033
return;
20342034
}
20352035
}
2036+
2037+
private boolean isPinchZoom(MouseEvent e) {
2038+
return ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0)
2039+
|| ((e.getModifiers() & MouseEvent.SHIFT_MASK) != 0);
2040+
}
20362041
private Cursor handCursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
20372042
private Cursor defaultCursor = Cursor.getDefaultCursor();
20382043
private int currentCursor = 0;

0 commit comments

Comments
 (0)