Changeset 18684 in josm for trunk/src


Ignore:
Timestamp:
2023-03-07T17:15:04+01:00 (14 months ago)
Author:
taylor.smock
Message:

Fix #22770: High precision scroll inputs may cause zoom events in the ImageDisplay

This is caused by the mouse wheel rotation being 0 (MouseWheelEvent#getWheelRotation )
which then caused the image viewer to perform a zoom event.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r18605 r18684  
    365365                currentVisibleRect.width = (int) (currentVisibleRect.width * ZOOM_STEP.get());
    366366                currentVisibleRect.height = (int) (currentVisibleRect.height * ZOOM_STEP.get());
    367             } else {
     367            } else if (rotation < 0) {
    368368                currentVisibleRect.width = (int) (currentVisibleRect.width / ZOOM_STEP.get());
    369369                currentVisibleRect.height = (int) (currentVisibleRect.height / ZOOM_STEP.get());
    370             }
     370            } // else rotation == 0, which can happen with some modern trackpads (see #22770)
    371371
    372372            // Check that the zoom doesn't exceed MAX_ZOOM:1
Note: See TracChangeset for help on using the changeset viewer.