Use SoftClamp for QueryWindow::FindWindowPlacementAndResize

See: #490
This commit is contained in:
Jonathan G Rennison
2023-03-01 18:15:26 +00:00
parent 412eab22c0
commit 36700631aa

View File

@@ -1224,8 +1224,8 @@ struct QueryWindow : public Window {
void FindWindowPlacementAndResize(int def_width, int def_height) override void FindWindowPlacementAndResize(int def_width, int def_height) override
{ {
/* Position query window over the calling window, ensuring it's within screen bounds. */ /* 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->left = SoftClamp(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->top = SoftClamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height);
this->SetDirty(); this->SetDirty();
} }