mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix resetting of available geometry fix in some cases
This commit is contained in:
parent
d79fab8b3c
commit
7de8d6f9ac
1 changed files with 4 additions and 4 deletions
|
@ -527,10 +527,10 @@ void MainWindow::initSize() {
|
||||||
if (rightPoint > w) {
|
if (rightPoint > w) {
|
||||||
const auto distance = rightPoint - w;
|
const auto distance = rightPoint - w;
|
||||||
const auto newXPos = position.x - distance;
|
const auto newXPos = position.x - distance;
|
||||||
if (newXPos >= 0) {
|
if (newXPos >= x) {
|
||||||
position.x = newXPos;
|
position.x = newXPos;
|
||||||
} else {
|
} else {
|
||||||
position.x = 0;
|
position.x = x;
|
||||||
const auto newRightPoint = position.x + position.w;
|
const auto newRightPoint = position.x + position.w;
|
||||||
const auto newDistance = newRightPoint - w;
|
const auto newDistance = newRightPoint - w;
|
||||||
position.w -= newDistance;
|
position.w -= newDistance;
|
||||||
|
@ -540,10 +540,10 @@ void MainWindow::initSize() {
|
||||||
if (bottomPoint > h) {
|
if (bottomPoint > h) {
|
||||||
const auto distance = bottomPoint - h;
|
const auto distance = bottomPoint - h;
|
||||||
const auto newYPos = position.y - distance;
|
const auto newYPos = position.y - distance;
|
||||||
if (newYPos >= 0) {
|
if (newYPos >= y) {
|
||||||
position.y = newYPos;
|
position.y = newYPos;
|
||||||
} else {
|
} else {
|
||||||
position.y = 0;
|
position.y = y;
|
||||||
const auto newBottomPoint = position.y + position.h;
|
const auto newBottomPoint = position.y + position.h;
|
||||||
const auto newDistance = newBottomPoint - h;
|
const auto newDistance = newBottomPoint - h;
|
||||||
position.h -= newDistance;
|
position.h -= newDistance;
|
||||||
|
|
Loading…
Add table
Reference in a new issue