#14740 closed defect (fixed)
Current displayed data position changes when you press TAB
Reported by: | IlBano | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 17.05 |
Component: | Core | Version: | latest |
Keywords: | template_report position tab regression | Cc: | bastiK, michael2402 |
Description
What steps will reproduce the problem?
- load an arbitrary amount of data from OSM
- press TAB to hide/show the toolbox
What is the expected result?
The current displayed data should remain in the same position as it was before hiding/showing toolbox
What happens instead?
The position of data on screen moves some pixel to the right every time the toolbox is set to hide with TAB key
Please provide any additional information below. Attach a screenshot if possible.
The previous stable release of JOSM was not affected
URL:http://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2017-05-02 23:28:33 +0200 (Tue, 02 May 2017) Build-Date:2017-05-02 21:34:40 Revision:12039 Relative:URL: ^/trunk Identification: JOSM/1.5 (12039 en) Windows 7 32-Bit Memory Usage: 236 MB / 247 MB (110 MB allocated, but free) Java version: 1.8.0_101-b13, Oracle Corporation, Java HotSpot(TM) Client VM Screen: \Display0 1600x900 Maximum Screen Size: 1600x900 VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=%UserProfile%\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-2681b3e8, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.splashport=58723, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp, -Djnlpx.jvm=<java.home>\bin\javaw.exe] Dataset consistency test: No problems found Plugins: + apache-commons (32994) + buildings_tools (33004) + ejml (32680) + geotools (33042) + jts (32699) + opendata (33245) + utilsplugin2 (33212) Tagging presets: + D:\Dati\Josm\myJosmPresets.xml Last errors/warnings: - W: Culvert: Could not get presets icon presets/tunnel.png - E: Failed to locate image 'presets/bridge.png' - W: Bridge: Could not get presets icon presets/bridge.png - E: Failed to locate image 'presets/river.png' - W: Ditch: Could not get presets icon presets/river.png - E: Failed to locate image 'presets/parking.png' - W: Parking: Could not get presets icon presets/parking.png - E: Failed to locate image 'presets/way_unclassified.png' - W: Service Hwy: Could not get presets icon presets/way_unclassified.png
Attachments (0)
Change History (18)
comment:1 by , 7 years ago
Cc: | added |
---|---|
Milestone: | → 17.05 |
Version: | → latest |
comment:2 by , 7 years ago
Component: | Core → Core mappaint |
---|
comment:3 by , 7 years ago
Keywords: | regression added |
---|
comment:4 by , 7 years ago
comment:5 by , 7 years ago
I don't know, I didn't check. I just added the keyword, as IlBano said "The previous stable release of JOSM was not affected"
comment:7 by , 7 years ago
I made a quick check with versions from https://josm.openstreetmap.de/download/. Should be somewehere between 11839 and 11845
follow-up: 9 comment:8 by , 7 years ago
proposed fix:
-
src/org/openstreetmap/josm/gui/MapViewState.java
230 230 } 231 231 232 232 /** 233 * Gets the center of the view, rounded to a pixel coordinate234 * @return The center position.235 * @since 10856236 */237 public MapViewPoint getCenterAtPixel() {238 return getForView(viewWidth / 2, viewHeight / 2);239 }240 241 /**242 233 * Gets the width of the view on the Screen; 243 234 * @return The width of the view component in screen pixel. 244 235 */ -
src/org/openstreetmap/josm/gui/NavigatableComponent.java
301 301 * Zoom in current view. Use configured zoom step and scaling settings. 302 302 */ 303 303 public void zoomIn() { 304 zoomTo(state.getCenter AtPixel().getEastNorth(), scaleZoomIn());304 zoomTo(state.getCenter().getEastNorth(), scaleZoomIn()); 305 305 } 306 306 307 307 /** … … 308 308 * Zoom out current view. Use configured zoom step and scaling settings. 309 309 */ 310 310 public void zoomOut() { 311 zoomTo(state.getCenter AtPixel().getEastNorth(), scaleZoomOut());311 zoomTo(state.getCenter().getEastNorth(), scaleZoomOut()); 312 312 } 313 313 314 314 protected void updateLocationState() { … … 405 405 * @return the current center of the viewport 406 406 */ 407 407 public EastNorth getCenter() { 408 return state.getCenter AtPixel().getEastNorth();408 return state.getCenter().getEastNorth(); 409 409 } 410 410 411 411 /**
follow-up: 13 comment:9 by , 7 years ago
comment:10 by , 7 years ago
Component: | Core mappaint → Core |
---|
follow-up: 14 comment:11 by , 7 years ago
It should be fine.
This was used to align the view to pixels. Now that we have other code for that it should be OK.
Have you tested zooming in and out a lot? There might be situations where the pixel rounding will introduce a offset so that you move the map by zooming. It did not happen in my current tests, but might be related to map view size/...
comment:13 by , 7 years ago
comment:14 by , 7 years ago
Replying to michael2402:
It should be fine.
This was used to align the view to pixels. Now that we have other code for that it should be OK.
Thanks!
Have you tested zooming in and out a lot? There might be situations where the pixel rounding will introduce a offset so that you move the map by zooming. It did not happen in my current tests, but might be related to map view size/...
Seems to be okay, but this can be very subtle, so we'll see.
comment:16 by , 7 years ago
I just found out that the same problem happens also when you move around using CTRL+<arrow key>... just to gives further details since I'm not able to understand if the proposed patch fixes also this.
follow-up: 18 comment:17 by , 7 years ago
The proposed patch has already been applied, please download version 12074 or later and test yourself!
comment:18 by , 7 years ago
Replying to bastiK:
The proposed patch has already been applied, please download version 12074 or later and test yourself!
Works with 12081. Thanks
Klumbumbus, regression from what version?