Skip to content
Snippets Groups Projects
Commit 9d85f4eb authored by Paul Guslisty's avatar Paul Guslisty
Browse files

Fixed normal EXT-6812 ([TRUNCATION] APARIENCIA window > Forma > Boca > Labios:...

Fixed normal EXT-6812 ([TRUNCATION] APARIENCIA window > Forma > Boca > Labios: prominec. \"Labios: prominenc\" should be \"Labios: prominencia\".)

- There was two reasons:
1. Uninitialized variable in llsliderctrl.(h/cpp) that contains label size. This variable take part in calculation of TextBox size of label.
2. Font of 'label string' and text box was different. This causes wrong calculation of 'label string' length.

Reviwed by Vadim Savchuk and Mike Antipov at https://codereview.productengine.com/secondlife/r/246/

--HG--
branch : product-engine
parent be039f30
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,8 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
mCanEditText(p.can_edit_text),
mPrecision(p.decimal_digits),
mTextEnabledColor(p.text_color()),
mTextDisabledColor(p.text_disabled_color())
mTextDisabledColor(p.text_disabled_color()),
mLabelWidth(p.label_width)
{
S32 top = getRect().getHeight();
S32 bottom = 0;
......@@ -86,6 +87,7 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
params.initial_value(p.label());
mLabelBox = LLUICtrlFactory::create<LLTextBox> (params);
addChild(mLabelBox);
mLabelFont = params.font();
}
if (p.show_text && !p.text_width.isProvided())
......@@ -186,9 +188,9 @@ BOOL LLSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit&
if (mLabelBox)
{
res = mLabelBox->setTextArg(key, text);
if (res && mLabelWidth == 0)
if (res && mLabelFont && mLabelWidth == 0)
{
S32 label_width = mFont->getWidth(mLabelBox->getText());
S32 label_width = mLabelFont->getWidth(mLabelBox->getText());
LLRect rect = mLabelBox->getRect();
S32 prev_right = rect.mRight;
rect.mRight = rect.mLeft + label_width;
......
......@@ -141,6 +141,7 @@ class LLSliderCtrl : public LLF32UICtrl
void reportInvalidData();
const LLFontGL* mFont;
const LLFontGL* mLabelFont;
BOOL mShowText;
BOOL mCanEditText;
......@@ -158,3 +159,4 @@ class LLSliderCtrl : public LLF32UICtrl
};
#endif // LL_LLSLIDERCTRL_H
......@@ -110,7 +110,6 @@
increment="1"
initial_value="0"
label="[DESC]"
label_width="100"
layout="bottom|left"
left="6"
max_val="100"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment