fix box overflow

Signed-off-by: sunfei <sunfei.sun@huawei.com>
Change-Id:  I3b11fd168dcbb4ee3481acb0abde4384b4ff3e7f
This commit is contained in:
jiangtao 2021-11-05 14:09:58 +00:00 committed by sunfei
parent a9dfd82e24
commit 7ee6ce1f10

View File

@ -313,10 +313,10 @@ void RenderBoxBase::CalculateSelfLayoutParam()
// allow overflow parent when set height or width, except when set flexgrow or flexshrink
if (context->GetIsDeclarative()) {
if (selfDefineWidth_ && layoutSetByParent.GetMinSize().Width() != layoutSetByParent.GetMaxSize().Width()) {
selfMax.SetWidth(constrainMax.Width() - margin_.GetLayoutSize().Width());
selfMax.SetWidth(constrainMax.Width());
}
if (selfDefineHeight_ && layoutSetByParent.GetMinSize().Height() != layoutSetByParent.GetMaxSize().Height()) {
selfMax.SetHeight(constrainMax.Height() - margin_.GetLayoutSize().Height());
selfMax.SetHeight(constrainMax.Height());
}
}