From 7de8d6f9ac56e1148369e9f4716244f452e23d49 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 11 May 2021 11:25:19 +0400 Subject: [PATCH] Fix resetting of available geometry fix in some cases --- Telegram/SourceFiles/window/main_window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 0fc89fccb..cf23abd76 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -527,10 +527,10 @@ void MainWindow::initSize() { if (rightPoint > w) { const auto distance = rightPoint - w; const auto newXPos = position.x - distance; - if (newXPos >= 0) { + if (newXPos >= x) { position.x = newXPos; } else { - position.x = 0; + position.x = x; const auto newRightPoint = position.x + position.w; const auto newDistance = newRightPoint - w; position.w -= newDistance; @@ -540,10 +540,10 @@ void MainWindow::initSize() { if (bottomPoint > h) { const auto distance = bottomPoint - h; const auto newYPos = position.y - distance; - if (newYPos >= 0) { + if (newYPos >= y) { position.y = newYPos; } else { - position.y = 0; + position.y = y; const auto newBottomPoint = position.y + position.h; const auto newDistance = newBottomPoint - h; position.h -= newDistance;