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/scrolllist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui/scrolllist.cpp') diff --git a/gui/scrolllist.cpp b/gui/scrolllist.cpp index ec42fe6c0..7bd4598e7 100644 --- a/gui/scrolllist.cpp +++ b/gui/scrolllist.cpp @@ -266,7 +266,7 @@ int GUIScrollList::Render(void) // render the text gr_color(mHeaderFontColor.red, mHeaderFontColor.green, mHeaderFontColor.blue, mHeaderFontColor.alpha); - gr_textEx(mRenderX + IconOffsetX + 5, yPos + (int)((mHeaderH - mFontHeight) / 2), mLastHeaderValue.c_str(), mFont->GetResource()); + gr_textEx_scaleW(mRenderX + IconOffsetX + 5, yPos + (int)(mHeaderH / 2), mLastHeaderValue.c_str(), mFont->GetResource(), mRenderW, TEXT_ONLY_RIGHT, 0); // Add the separator gr_color(mHeaderSeparatorColor.red, mHeaderSeparatorColor.green, mHeaderSeparatorColor.blue, mHeaderSeparatorColor.alpha); @@ -346,8 +346,8 @@ void GUIScrollList::RenderStdItem(int yPos, bool selected, ImageResource* icon, // render label text int textX = mRenderX + maxIconWidth + 5; - int textY = yPos + (iconAndTextH - mFontHeight) / 2; - gr_textEx(textX, textY, text, mFont->GetResource()); + int textY = yPos + (iconAndTextH / 2); + gr_textEx_scaleW(textX, textY, text, mFont->GetResource(), mRenderW, TEXT_ONLY_RIGHT, 0); } int GUIScrollList::Update(void) -- cgit v1.2.3