Final window center adjustments

This commit is contained in:
crschnick 2024-05-17 14:59:44 +00:00
parent b63f899a86
commit 8bc5ea0688

View file

@ -49,6 +49,11 @@ public class AppWindowHelper {
var n = newValue.doubleValue();
var o = oldValue.doubleValue();
if (stage.isShowing() && areNumbersValid(o, n)) {
// Ignore rounding events
if (Math.abs(n - o) < 0.5) {
return;
}
if (!xSet.getAndSet(true) && !stage.isMaximized() && n <= 0.0 && o > 0.0 && Math.abs(n - o) > 100) {
stage.setX(o);
}
@ -60,6 +65,11 @@ public class AppWindowHelper {
var n = newValue.doubleValue();
var o = oldValue.doubleValue();
if (stage.isShowing() && areNumbersValid(o, n)) {
// Ignore rounding events
if (Math.abs(n - o) < 0.5) {
return;
}
if (!ySet.getAndSet(true) && !stage.isMaximized() && n <= 0.0 && o > 0.0 && Math.abs(n - o) > 20) {
stage.setY(o);
}