_Control::UpdateBoundsOfVisualElement(const FloatRectangle& controlBounds)
{
FloatRectangle rect(controlBounds.x, controlBounds.y, controlBounds.width, controlBounds.height);
- FloatRectangle previousBounds = GetVisualElement()->GetBounds();
- const bool moved = (previousBounds.x != rect.x) || (previousBounds.y != rect.y);
- const bool resized = (previousBounds.width != rect.width) || (previousBounds.height != rect.height);
-
- if (moved || resized)
+ _Control* pParent = GetParent();
+ if (__area == _CONTROL_AREA_CLIENT && pParent)
{
- _Control* pParent = GetParent();
- if (__area == _CONTROL_AREA_CLIENT && pParent)
- {
- const FloatRectangle clientBounds = pParent->GetClientBoundsF();
- rect.x += clientBounds.x;
- rect.y += clientBounds.y;
- }
-
- GetVisualElement()->SetBounds(rect);
+ const FloatRectangle clientBounds = pParent->GetClientBoundsF();
+ rect.x += clientBounds.x;
+ rect.y += clientBounds.y;
}
+
+ GetVisualElement()->SetBounds(rect);
+
return E_SUCCESS;
}