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/checkbox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gui/checkbox.cpp') diff --git a/gui/checkbox.cpp b/gui/checkbox.cpp index 46a770861..8eb0f529d 100644 --- a/gui/checkbox.cpp +++ b/gui/checkbox.cpp @@ -139,9 +139,11 @@ int GUICheckbox::SetRenderPos(int x, int y, int w, int h) mRenderH = mCheckH; mTextX = mRenderX + mCheckW + 5; - mTextY = mRenderY + ((mCheckH / 2) - (textH / 2)); + mTextY = mRenderY + (mCheckH / 2); mLabel->SetRenderPos(mTextX, mTextY, 0, 0); + mLabel->SetPlacement(TEXT_ONLY_RIGHT); + mLabel->SetMaxWidth(gr_fb_width() - mTextX); SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH); return 0; } -- cgit v1.2.3