Fix centering the Console correctly when using UI w/multiple windows

This commit is contained in:
David Capello 2022-01-11 10:41:36 -03:00
parent efd8a71b9f
commit d52455b200
2 changed files with 6 additions and 4 deletions

2
laf

@ -1 +1 @@
Subproject commit a6e51dcc134e42e27ce96b0b634de28599ab49b3 Subproject commit f9149d4b80c6a7bb21dcfbd267ef510816f75abc

View File

@ -1,5 +1,5 @@
// Aseprite UI Library // Aseprite UI Library
// Copyright (C) 2019-2021 Igara Studio S.A. // Copyright (C) 2019-2022 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2016 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
@ -134,8 +134,10 @@ void fit_bounds(const Display* parentDisplay,
window->setBounds(gfx::Rect(0, 0, frame.w / scale, frame.h / scale)); window->setBounds(gfx::Rect(0, 0, frame.w / scale, frame.h / scale));
window->loadNativeFrame(frame); window->loadNativeFrame(frame);
if (window->isVisible()) if (window->isVisible()) {
window->expandWindow(frame.size() / scale); if (window->ownDisplay())
window->display()->nativeWindow()->setFrame(frame);
}
} }
else { else {
const gfx::Rect displayBounds(parentDisplay->size()); const gfx::Rect displayBounds(parentDisplay->size());