mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Restore ui::Window bounds correctly after loading its lastNativeFrame()
Without this fix windows were missing a last re-layout/setBounds to the new frame size, so they showed up with an incorrect size given the available area of the native window.
This commit is contained in:
parent
a5b41d2630
commit
7f56db58b7
2
laf
2
laf
@ -1 +1 @@
|
||||
Subproject commit 67daddc2801975328f3665c49e1f03344ab85d22
|
||||
Subproject commit 9957462b8833bd9dcdd642b7fa15b5d0f46de397
|
@ -1334,14 +1334,17 @@ void Manager::_openWindow(Window* window, bool center)
|
||||
|
||||
os::WindowSpec spec;
|
||||
gfx::Rect frame;
|
||||
bool changeFrame;
|
||||
if (!window->lastNativeFrame().isEmpty()) {
|
||||
frame = window->lastNativeFrame();
|
||||
changeFrame = true;
|
||||
}
|
||||
else {
|
||||
gfx::Rect relativeToFrame = parentDisplay->nativeWindow()->contentRect();
|
||||
frame = window->bounds();
|
||||
frame *= scale;
|
||||
frame.offset(relativeToFrame.origin());
|
||||
changeFrame = false;
|
||||
}
|
||||
|
||||
limit_with_workarea(parentDisplay, frame);
|
||||
@ -1382,7 +1385,12 @@ void Manager::_openWindow(Window* window, bool center)
|
||||
m_display.nativeWindow()->activate();
|
||||
|
||||
// Move all widgets to the os::Display origin (0,0)
|
||||
window->offsetWidgets(-window->origin().x, -window->origin().y);
|
||||
if (changeFrame) {
|
||||
window->setBounds(newNativeWindow->bounds() / scale);
|
||||
}
|
||||
else {
|
||||
window->offsetWidgets(-window->origin().x, -window->origin().y);
|
||||
}
|
||||
|
||||
// Handle native hit testing. Required to be able to move/resize
|
||||
// a window with a non-mouse pointer (e.g. stylus) on Windows.
|
||||
|
Loading…
x
Reference in New Issue
Block a user