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
This commit is contained in:
Ethan Yonker
2015-11-06 15:24:26 -06:00
parent a1de1496a9
commit fd52b987e5
+4 -1
View File
@@ -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);
}
}
}