#22770 closed defect (fixed)
Can't zoom out image with scrolling in the Image Viewer (macos)
Reported by: | pluton | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 23.03 |
Component: | Core image mapping | Version: | tested |
Keywords: | template_report zoom | Cc: |
Description
What steps will reproduce the problem?
- Open an image, then open the image viewer (
y
). - Scroll down on the trackpad (I test on MacBook Pro 2015) to zoom in.
- Try scrolling up on the trackpad.
What is the expected result?
The image doesn't zoom out to the initial zoom. It can sometimes zoom out one level. If I scroll up a lot, I see that the image flickers between different zoom levels quickly, but then returns to the zoomed-in state.
Maybe this issue is macos-specific.
What happens instead?
The image should zoom out one level.
Please provide any additional information below. Attach a screenshot if possible.
Revision:18646 Build-Date:2023-01-30 15:17:59 Identification: JOSM/1.5 (18646 en) Mac OS X 12.6.3 OS Build number: macOS 12.6.3 (21G419) Memory Usage: 808 MB / 4096 MB (383 MB allocated, but free) Java version: 17.0.6+10-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM Look and Feel: com.apple.laf.AquaLookAndFeel Screen: Display 69733248 1680×1050 (scaling 2.00×2.00) Maximum Screen Size: 1680×1050 Best cursor sizes: 16×16→16×16, 32×32→32×32 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 VM arguments: [-Djpackage.app-version=18646, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=/Applications/JOSM.app/Contents/MacOS/JOSM] Dataset consistency test: No problems found Plugins: + CustomizePublicTransportStop (35976) + FastDraw (35978) + ImproveWay (32) + Mapillary (2.1.1) + apache-commons (36034) + apache-http (35924) + buildings_tools (36011) + easypresets (1623509627) + intersection (0.0.7) + javafx (36034) + jna (36005) + mapwithai (785) + pt_assistant (1ff2e15) + reltoolbox (35976) + reverter (36043) + tageditor (36011) + todo (30306) + turnlanes-tagging (v0.0.5) + turnrestrictions (36011) + undelete (36011) + utilsplugin2 (36011) + waydownloader (36011) + wikipedia (605) Tagging presets: + https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/UA.zip + <josm.userdata>/EasyPresets.xml + <josm.userdata>/custom/presets.xml + https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/CommonKeyboardShortcuts&zip=1 Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1 - <josm.userdata>/custom/railroad.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1 - <josm.userdata>/custom/notes.mapcss - https://raw.githubusercontent.com/yopaseopor/traffic_signs_style_JOSM/master/Styles_Traffic_signs_EUR_OR.zip - https://josm.openstreetmap.de/josmfile?page=Styles/Bench&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Incline&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/RecyclingMaterials&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PriorityRoad&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Kerbs&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 + https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip Validator rules: + https://josm.openstreetmap.de/josmfile?page=Rules/UkrainePhoneNumbers&zip=1 + https://raw.githubusercontent.com/mellangr/ukrainian-streets-and-addresses-validator/main/uk_street_names_and_addresses_rules.mapcss + https://www.openrailwaymap.org/validator/openrailwaymap.validator.mapcss + https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1 - https://josm.openstreetmap.de/josmfile?page=Rules/SourceObjectTag&zip=1 Last errors/warnings: - 00049.342 E: Failed to locate image 'MapWithAI'
Attachments (1)
Change History (8)
by , 23 months ago
Attachment: | scrolling_.gif added |
---|
comment:1 by , 23 months ago
Component: | Core → Core image mapping |
---|---|
Keywords: | zoom added |
Version: | → tested |
Cannot reproduce on Linux, so it might be macos-specific or even depend on the Look and Feel: com.apple.laf.AquaLookAndFeel.
comment:3 by , 23 months ago
I get the same behaviour - r18622, macOS 11.7.4, aqua LAF, Azul Java 19.0.2+7, MacBook Air 2015. Same with Metal LAF. A mouse with a scroll wheel works as expected. Scrolling on the trackpad works as expected when zooming the Map View.
comment:4 by , 23 months ago
Milestone: | → 23.03 |
---|
Well, I think I've got a fix. Which is really stupid.
-
src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java b/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
a b 364 377 if (rotation > 0) { 365 378 currentVisibleRect.width = (int) (currentVisibleRect.width * ZOOM_STEP.get()); 366 379 currentVisibleRect.height = (int) (currentVisibleRect.height * ZOOM_STEP.get()); 367 } else {380 } else if (rotation < 0) { 368 381 currentVisibleRect.width = (int) (currentVisibleRect.width / ZOOM_STEP.get()); 369 382 currentVisibleRect.height = (int) (currentVisibleRect.height / ZOOM_STEP.get()); 370 } 383 } // else rotation == 0, which can happen with high precision trackpads (see #22770). 371 384 372 385 // Check that the zoom doesn't exceed MAX_ZOOM:1 373 386 ensureMaxZoom(currentVisibleRect);
Anyway, I'm writing a test for it.
On this (non-looping) gif, I scroll down at the beginning, then scroll up a few times causing the flickering