GUI: fix possible division by zero

This commit is contained in:
tildearrow 2023-06-02 14:06:25 -05:00
parent 827a0074ba
commit 8c10c7ed5d
1 changed files with 6 additions and 1 deletions

View File

@ -6209,7 +6209,12 @@ bool FurnaceGUI::init() {
// special consideration for Wayland
if (settings.dpiScale<0.5f) {
if (strcmp(videoBackend,"wayland")==0) {
dpiScale=(double)canvasW/(double)scrW;
if (scrW<1) {
logW("screen width is zero!\n");
dpiScale=1.0;
} else {
dpiScale=(double)canvasW/(double)scrW;
}
}
}