__pFont->GetTextExtent(newValue, newValue.GetLength(), newTextDim);
__pFont->GetTextExtent(__lastSelectedValue, __lastSelectedValue.GetLength(), oldTextDim);
+ newTextDim.width += 2.0f;
+ oldTextDim.width += 2.0f;
+
if (newTextDim.width > oldTextDim.width)
{
__pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
pNewVisualElement->SetBounds(FloatRectangle(0.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
- rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
- rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
- rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
- rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
+ rect.width = __pContentProvider->GetBounds().width;
+ rect.height = __pContentProvider->GetBounds().height;
textPoint.x = (rect.width - oldTextDim.width) / 2.0f;
textPoint.y = (rect.height - oldTextDim.height) / 2.0f;
+ rect.x = __pContentProvider->GetBounds().x - 2.0f;
+ rect.y = __pContentProvider->GetBounds().y;
+ rect.width = __pContentProvider->GetBounds().width + 4.0f;
+
pOldVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
}
else
__pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
pOldVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
- rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
- rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
- rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
- rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
+ rect.width = __pContentProvider->GetBounds().width;
+ rect.height = __pContentProvider->GetBounds().height;
textPoint.x = (rect.width - newTextDim.width) / 2.0f;
textPoint.y = (rect.height - newTextDim.height) / 2.0f;
+ rect.x = __pContentProvider->GetBounds().x - 2.0f;
+ rect.y = __pContentProvider->GetBounds().y;
+ rect.width = __pContentProvider->GetBounds().width + 4.0f;
+
pNewVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
}
-
pCanvas = pEditDateElement->GetCanvasN(rect);
pCanvas->SetBackgroundColor(contentBgColor);
pCanvas->Clear();
delete pCanvas;
+ pCanvas = null;
pEditDateElement->AttachChild(*__pContentProvider);