Fix std::clamp() assert in Manager::onInitTheme()

This commit is contained in:
David Capello 2023-10-11 15:05:10 -03:00
parent eea59a58dd
commit f6db44b81d

View File

@ -1778,8 +1778,8 @@ void Manager::onInitTheme(InitThemeEvent& ev)
gfx::Rect bounds = window->bounds();
bounds *= newUIScale;
bounds /= oldUIScale;
bounds.x = std::clamp(bounds.x, 0, displaySize.w - bounds.w);
bounds.y = std::clamp(bounds.y, 0, displaySize.h - bounds.h);
bounds.x = std::clamp(bounds.x, 0, std::max(0, displaySize.w - bounds.w));
bounds.y = std::clamp(bounds.y, 0, std::max(0, displaySize.h - bounds.h));
window->setBounds(bounds);
}
}