fix setfont logic
authorMyung Jin Kim <critical.kim@samsung.com>
Fri, 29 Mar 2013 05:44:21 +0000 (14:44 +0900)
committerMyung Jin Kim <critical.kim@samsung.com>
Fri, 29 Mar 2013 05:44:21 +0000 (14:44 +0900)
Change-Id: Ia84e6c159000e43e85e37839f64405916d9c8323

src/ui/controls/FUiCtrl_LabelPresenter.cpp

index 5012f95..fdfbb3a 100755 (executable)
@@ -140,12 +140,6 @@ _LabelPresenter::InitTextObject(void)
        __pTextObject->AppendElement(*pSimpleText);
        __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
-       __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
-       __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
-       __pTextObject->SetBounds(FloatRectangle(__pLabel->GetLeftMargin(), __pLabel->GetTopMargin(),
-                       __pLabel->GetBoundsF().width - (__pLabel->GetLeftMargin() + __pLabel->GetRightMargin()),
-                       __pLabel->GetBoundsF().height - (__pLabel->GetTopMargin() + __pLabel->GetBottomMargin())));
-       __pTextObject->Compose();
 
        return E_SUCCESS;
 }
@@ -197,6 +191,8 @@ _LabelPresenter::SetTextConfig(float size, LabelTextStyle style)
        __pFont->SetStrikeOut(isStrikeOut);
        __pFont->SetUnderline(isUnderLine);
 
+       __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
+
        return E_SUCCESS;
 }
 
@@ -368,10 +364,6 @@ _LabelPresenter::DrawText(void)
                return;
        }
 
-       __pTextObject->RemoveAll(true);
-       pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pLabel->GetText().GetPointer()), __pLabel->GetText().GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
-       __pTextObject->AppendElement(*pSimpleText);
-
        __pTextObject->SetForegroundColor(__pLabel->GetTextColor(), 0, __pTextObject->GetTextLength());
        __pTextObject->SetBounds(rect);
        __pTextObject->Compose();
@@ -401,7 +393,6 @@ _LabelPresenter::DrawText(void)
        }
 
        __pTextObject->SetAlignment(horizontalAlign | verticalAlign);
-       __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
        __pTextObject->SetBounds(rect);
        __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));