From fd52b987e5c8e6a66aefb04fd56081277e225b18 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 6 Nov 2015 15:24:26 -0600 Subject: Fix bution action position when using textplacement TEXT_ONLY_RIGHT This makes the touch target include both the text and the image for buttons masquerading as a check box. Change-Id: If8432c5863de136b1a215dabb3e06109ccce4410 --- gui/button.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gui/button.cpp') diff --git a/gui/button.cpp b/gui/button.cpp index 601a51667..a4c1b52bd 100644 --- a/gui/button.cpp +++ b/gui/button.cpp @@ -104,10 +104,13 @@ GUIButton::GUIButton(xml_node<>* node) mButtonLabel->SetRenderPos(mTextX, mTextY); } else { mTextX = mRenderW + mRenderX + 5; - mRenderW += mTextW + 5; mButtonLabel->GetCurrentBounds(mTextW, mTextH); + mRenderW += mTextW + 5; mTextY = mRenderY + (mRenderH / 2) - (mTextH / 2); mButtonLabel->SetRenderPos(mTextX, mTextY); + if (mAction) + mAction->SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH); + SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH); } } } -- cgit v1.2.3