From 36700631aa7466e82449ed1597264e3d1f965e72 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 1 Mar 2023 18:15:26 +0000 Subject: [PATCH] Use SoftClamp for QueryWindow::FindWindowPlacementAndResize See: #490 --- src/misc_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 3aade766d6..f61034c5c1 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1224,8 +1224,8 @@ struct QueryWindow : public Window { void FindWindowPlacementAndResize(int def_width, int def_height) override { /* Position query window over the calling window, ensuring it's within screen bounds. */ - this->left = Clamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width); - this->top = Clamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height); + this->left = SoftClamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width); + this->top = SoftClamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height); this->SetDirty(); }