mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-20 15:14:04 -04:00
[web]check drawsize to avoid INFINITE_SIZE
Signed-off-by: liwenzhen <liwenzhen3@huawei.com> Change-Id: I0140d73fea5836ab80897e608efdf6e8f3cbd974
This commit is contained in:
@@ -83,10 +83,8 @@ void RenderWeb::PerformLayout()
|
||||
}
|
||||
|
||||
// render web do not support child.
|
||||
drawSize_ = Size(GetLayoutParam().GetMaxSize().Width(),
|
||||
(GetLayoutParam().GetMaxSize().Height() == Size::INFINITE_SIZE) ?
|
||||
Size::INFINITE_SIZE :
|
||||
(GetLayoutParam().GetMaxSize().Height()));
|
||||
drawSize_ = Size(GetLayoutParam().GetMaxSize().Width(), GetLayoutParam().GetMaxSize().Height());
|
||||
|
||||
SetLayoutSize(drawSize_);
|
||||
SetNeedLayout(false);
|
||||
MarkNeedRender();
|
||||
|
||||
@@ -62,7 +62,7 @@ void RosenRenderWeb::Paint(RenderContext& context, const Offset& offset)
|
||||
if (pipelineContext->GetIsDragStart()) {
|
||||
drawSize_ = Size(1.0, 1.0);
|
||||
}
|
||||
if (drawSize_.Width() > pipelineContext->GetRootWidth() || drawSize_.Height() > pipelineContext->GetRootHeight()) {
|
||||
if (drawSize_.Width() == Size::INFINITE_SIZE || drawSize_.Height() == Size::INFINITE_SIZE) {
|
||||
LOGE("Web drawSize height or width is invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user