mirror of
https://github.com/xpipe-io/xpipe.git
synced 2025-04-19 02:33:39 +00:00
Final window center adjustments
This commit is contained in:
parent
b63f899a86
commit
8bc5ea0688
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue