From b7a54a30167f211647222c0a2f90b369e0e33e32 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 5 Oct 2015 10:16:27 -0500 Subject: Allow text to scale to fit Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd --- gui/keyboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gui/keyboard.cpp') diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index f35a5d318..e55fb1b66 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -326,7 +326,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH) int textH = labelFont->GetHeight(); int textX = keyX + (keyW - textW) / 2; int textY = keyY + (keyH - textH) / 2; - gr_textEx(textX, textY, labelText.c_str(), fontResource); + gr_textEx_scaleW(textX, textY, labelText.c_str(), fontResource, keyW, TOP_LEFT, 0); } // longpress key label (only if font is defined) @@ -339,7 +339,7 @@ void GUIKeyboard::DrawKey(Key& key, int keyX, int keyY, int keyW, int keyH) int textW = gr_measureEx(text.c_str(), fontResource); int textX = keyX + keyW - longpressOffsetX - textW; int textY = keyY + longpressOffsetY; - gr_textEx(textX, textY, text.c_str(), fontResource); + gr_textEx_scaleW(textX, textY, text.c_str(), fontResource, keyW, TOP_LEFT, 0); } } -- cgit v1.2.3