mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-01 21:52:12 +01:00
Don't restore sketch if last.sketch.location is out of display
`if ((screen.width != screenW) || (screen.height != screenH))` was making sure to reset every preference in case the display geometry changed. Unfortunately, on Windows 10, `Toolkit.getDefaultToolkit().getScreenSize()` reports only the primary monitor either if external display is connected or not. Fixes #9781
This commit is contained in:
parent
6f943ea4a8
commit
558ddd3d91
@ -621,7 +621,12 @@ public class Base {
|
||||
.get("last.sketch" + index + ".location");
|
||||
if (locationStr == null)
|
||||
return defaultEditorLocation();
|
||||
return PApplet.parseInt(PApplet.split(locationStr, ','));
|
||||
|
||||
int location[] = PApplet.parseInt(PApplet.split(locationStr, ','));
|
||||
if (location[0] > screen.width || location[1] > screen.height)
|
||||
return defaultEditorLocation();
|
||||
|
||||
return location;
|
||||
}
|
||||
|
||||
protected void storeRecentSketches(SketchController sketch) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user