mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-23 16:09:20 -04:00
Final window center adjustments
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user