summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-06 23:02:10 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-14 11:50:18 +0100
commit8906e9e0fd6dc7bd64f9ad2c633da6f110dbf921 (patch)
tree1e7af880ab09e61409a8891384a75f56c32a4e81 /src
parentb66e977acd6790d2e7c26d39f17ac5158b499167 (diff)
downloadopenttd-8906e9e0fd6dc7bd64f9ad2c633da6f110dbf921.tar.xz
Codechange: Consistently use screen size and not driver resolution for determining window sizes.
Diffstat (limited to 'src')
-rw-r--r--src/video/cocoa/cocoa_v.mm2
-rw-r--r--src/window.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 5493c0652..c1fb996de 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -270,7 +270,7 @@ bool VideoDriver_Cocoa::ToggleFullscreen(bool full_screen)
*/
bool VideoDriver_Cocoa::AfterBlitterChange()
{
- this->ChangeResolution(_screen.width, _screen.height);
+ this->ChangeResolution(_cur_resolution.width, _cur_resolution.height);
this->UpdatePalette(0, 256);
return true;
}
diff --git a/src/window.cpp b/src/window.cpp
index aea7bf341..5e49aacb0 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2158,8 +2158,8 @@ void ResizeWindow(Window *w, int delta_x, int delta_y, bool clamp_to_screen)
* the resolution clamp it in such a manner that it stays within the bounds. */
int new_right = w->left + w->width + delta_x;
int new_bottom = w->top + w->height + delta_y;
- if (new_right >= (int)_cur_resolution.width) delta_x -= Ceil(new_right - _cur_resolution.width, std::max(1U, w->nested_root->resize_x));
- if (new_bottom >= (int)_cur_resolution.height) delta_y -= Ceil(new_bottom - _cur_resolution.height, std::max(1U, w->nested_root->resize_y));
+ if (new_right >= (int)_screen.width) delta_x -= Ceil(new_right - _screen.width, std::max(1U, w->nested_root->resize_x));
+ if (new_bottom >= (int)_screen.height) delta_y -= Ceil(new_bottom - _screen.height, std::max(1U, w->nested_root->resize_y));
}
w->SetDirty();
@@ -3468,7 +3468,7 @@ void ReInitAllWindows()
NetworkReInitChatBoxSize();
/* Make sure essential parts of all windows are visible */
- RelocateAllWindows(_cur_resolution.width, _cur_resolution.height);
+ RelocateAllWindows(_screen.width, _screen.height);
MarkWholeScreenDirty();
}