Skip to content

Commit

Permalink
Merge pull request #6421 from Android-X13/fix-overlay-centering
Browse files Browse the repository at this point in the history
Fix horizontal centering of overlays on Windows
  • Loading branch information
alejandrogarcia83 authored Nov 29, 2022
2 parents 1c47d22 + f0c353c commit 32cab05
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,9 @@ protected void layout() {
double titleBarHeight = window.getHeight() - rootScene.getHeight();
if (Utilities.isWindows())
titleBarHeight -= 9;
stage.setX(Math.round(window.getX() + (owner.getWidth() - stage.getWidth()) / 2));

double windowWidth = Utilities.isWindows() ? window.getWidth() : owner.getWidth();
stage.setX(Math.round(window.getX() + (windowWidth - stage.getWidth()) / 2));

if (type.animationType == AnimationType.SlideDownFromCenterTop)
stage.setY(Math.round(window.getY() + titleBarHeight));
Expand Down

0 comments on commit 32cab05

Please sign in to comment.