Mapview resize without reinitializing a new renderer each time - #2491
Mapview resize without reinitializing a new renderer each time#2491Auriga2 wants to merge 1 commit into
Conversation
|
|
Thanks @OrionsGuardian, setting the laptop display The above issue can easily be fixed with a zoom in/out or a window maximizing/minimizing. It happens if you move the vertical divider very fast. |
OrionsGuardian
left a comment
There was a problem hiding this comment.
Please also address the sonar code smells.
| @Override | ||
| public void draw() { | ||
| assert !SwingUtilities.isEventDispatchThread(); | ||
| float currentZoom = map.getZoomLevel(); |
| } | ||
| return null; | ||
| }, 500, TimeUnit.MILLISECONDS); | ||
| public void componentResized(ComponentEvent e) { |
| private final List<? extends MapExporter> exporters; | ||
| private final MarkerState markerState; | ||
| private int cachedWidth; | ||
| private int cachedHeight; |
There was a problem hiding this comment.
cachedWidth and cachedHeight don't appear to be used anywhere.
They have values assigned to them, but never used.
There was a problem hiding this comment.
Can confirm on a laptop screen that the map doesn't scale. Also came across a bug where if I open the map view, switch to another view in the same place, and then go back to the map view, it still renders a portion of the previous view in the gaps where the map isn't rendering.
Edit: I'm actually getting the same issue on master so it might not be specific to this change
|
It's the same root cause on the smaller screen (screen with a different scale) where it doesn't identify the entire space as available for the map, causing a bigger background. When resizing to a smaller size it doesn't clear, leaving parts of the previous map/view in the background. This could still happen in the I can fix the issue that Delphinus8821 noted above. |




Prerequisites
Reviewed the checklist
Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
for the "CI / Unit Tests") to complete first. Failed Unit tests can be
debugged by adding the label "verbose logging" to the GitHub PR.
Description of the Change
This works perfectly only on certain displays. It works on my monitor but not the laptop screen:
On the smaller screen it doesn't identify the entire space as available for the map, causing a bigger background. When resizing to a smaller size it doesn't clear, leaving parts of the previous map in the background. This could still happen in the Alternate Design but less likely.
Sometimes this can cause issues when moving constellation window between displays with different resolutions. This can move the map to appear displaced and floating when the constellation window is floating. It fixes when the constellation window is docked.
This appears to be a limitations with AWT/Swing using floating top‑level native windows that can move between monitors with different DPI/scale, and JOGL/NEWT embedding a native OpenGL child window (GLWindow) via native reparenting (NewtCanvasAWT).
Probably we could implement this or similar after #1746
Alternate Designs
#2490
Why Should This Be In Core?
Benefits
Better performance when resizing.
Possible Drawbacks
Verification Process
Same as in #2490
Applicable Issues
#2376
#618