Add checks preventing a number of "possible" divisions by 0 in layout

This commit is contained in:
Henrik Rydgård committed 2022-11-30 10:15:30 +01:00
1 parent f4ea78c035
commit 0ff5e0a955
2 files changed
+24 -12

No files matched your search

+1 -1
View File
@@ -618,7 +618,7 @@ void TouchControlLayoutScreen::CreateViews() {
InitPadLayout(bounds.w, bounds.h);
const float leftColumnWidth = 170.0f;
layoutAreaScale = 1.0-(leftColumnWidth+10)/bounds.w;
layoutAreaScale = 1.0f - (leftColumnWidth + 10.0f) / std::max(bounds.w, 1.0f);
auto co = GetI18NCategory("Controls");
auto di = GetI18NCategory("Dialog");