From 4df34ffc014e2765b45d72f94dc23925f8b13ece Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 31 Aug 2013 01:00:57 -0700 Subject: [PATCH] Correctly resize text on Android / non sys fonts. --- ui/ui_context.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/ui_context.cpp b/ui/ui_context.cpp index f9f1c5e822..a34d881f93 100644 --- a/ui/ui_context.cpp +++ b/ui/ui_context.cpp @@ -164,6 +164,8 @@ void UIContext::DrawText(const char *str, float x, float y, uint32_t color, int void UIContext::DrawTextRect(const char *str, const Bounds &bounds, uint32_t color, int align) { if (!textDrawer_ || (align & FLAG_DYNAMIC_ASCII)) { + float sizeFactor = (float)fontStyle_->sizePts / 24.0f; + Draw()->SetFontScale(fontScaleX_ * sizeFactor, fontScaleY_ * sizeFactor); Draw()->DrawTextRect(fontStyle_->atlasFont, str, bounds.x, bounds.y, bounds.w, bounds.h, color, align); } else { textDrawer_->SetFontScale(fontScaleX_, fontScaleY_);