summaryrefslogtreecommitdiffstats
path: root/gui/gui.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-02-14 21:20:10 +0100
committerDees Troy <dees_troy@teamw.in>2015-02-23 15:39:15 +0100
commitba75a0e73bf23261b16abf858853578ea65576f8 (patch)
tree314b281aa0177572f8c9e6e2004b0e1cf9b6e77d /gui/gui.cpp
parentFix reboot system on watch theme (diff)
downloadandroid_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar.gz
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar.bz2
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar.lz
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar.xz
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.tar.zst
android_bootable_recovery-ba75a0e73bf23261b16abf858853578ea65576f8.zip
Diffstat (limited to 'gui/gui.cpp')
-rw-r--r--gui/gui.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 35b33b10c..f3d31d7b3 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -990,7 +990,10 @@ extern "C" void set_scale_values(float w, float h)
extern "C" int scale_theme_x(int initial_x)
{
if (scale_theme_w != 1) {
- return (int) ((float)initial_x * scale_theme_w);
+ int scaled = (float)initial_x * scale_theme_w;
+ if (scaled == 0 && initial_x > 0)
+ return 1;
+ return scaled;
}
return initial_x;
}
@@ -998,7 +1001,10 @@ extern "C" int scale_theme_x(int initial_x)
extern "C" int scale_theme_y(int initial_y)
{
if (scale_theme_h != 1) {
- return (int) ((float)initial_y * scale_theme_h);
+ int scaled = (float)initial_y * scale_theme_h;
+ if (scaled == 0 && initial_y > 0)
+ return 1;
+ return scaled;
}
return initial_y;
}