summaryrefslogtreecommitdiffstats
path: root/gui/keyboard.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:36 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:39 +0200
commit58f2132bc3954fc704787d477500a209eedb8e29 (patch)
treeeb0f79aacd68724b0c0c091018384ef924380f47 /gui/keyboard.cpp
parentRemove remaining pieces of supersu (diff)
parentSnap for 4745538 from 723056a83f8c8b15af02d9c302862dbb2304ea8c to pi-release (diff)
downloadandroid_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.gz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.bz2
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.lz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.xz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.zst
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.zip
Diffstat (limited to '')
-rw-r--r--gui/keyboard.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp
index 849cf19d8..ca7006dc3 100644
--- a/gui/keyboard.cpp
+++ b/gui/keyboard.cpp
@@ -322,7 +322,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH)
gr_color(mFontColorSmall.red, mFontColorSmall.green, mFontColorSmall.blue, mFontColorSmall.alpha);
}
- if (labelImage)
+ if (labelImage && labelImage->GetResource())
{
int w = labelImage->GetWidth();
int h = labelImage->GetHeight();
@@ -330,7 +330,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH)
int y = keyY + (keyH - h) / 2;
gr_blit(labelImage->GetResource(), 0, 0, w, h, x, y);
}
- else if (!labelText.empty())
+ else if (!labelText.empty() && labelFont && labelFont->GetResource())
{
void* fontResource = labelFont->GetResource();
int textW = gr_ttf_measureEx(labelText.c_str(), fontResource);
@@ -342,7 +342,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH)
// longpress key label (only if font is defined)
keychar = key.longpresskey;
- if (keychar > 32 && keychar < 127 && mLongpressFont->GetResource()) {
+ if (keychar > 32 && keychar < 127 && mLongpressFont && mLongpressFont->GetResource()) {
void* fontResource = mLongpressFont->GetResource();
gr_color(mLongpressFontColor.red, mLongpressFontColor.green, mLongpressFontColor.blue, mLongpressFontColor.alpha);
string text(1, keychar);