UI: Allow measuring text with a scale.

This commit is contained in:
Unknown W. Brackets committed 2016-08-07 16:49:50 -07:00
1 parent 2076d66663
commit d6820f3cc3
7 files changed
+32 -32

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
// Get height
float w, h;
dc.MeasureText(dc.theme->uiFont, "Wg", &w, &h);
dc.MeasureText(dc.theme->uiFont, 1.0f, 1.0f, "Wg", &w, &h);
float y = 10.0f;
// Then draw them all.
@@ -27,7 +27,7 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
if (alpha < 0.0) alpha = 0.0f;
// Messages that are wider than the screen are left-aligned instead of centered.
float tw, th;
dc.MeasureText(dc.theme->uiFont, iter->text.c_str(), &tw, &th);
dc.MeasureText(dc.theme->uiFont, 1.0f, 1.0f, iter->text.c_str(), &tw, &th);
float x = bounds_.centerX();
int align = ALIGN_TOP | ALIGN_HCENTER;
if (tw > bounds_.w) {