Skip to content

Commit

Permalink
fix(dom): layout width and height result great than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikethese committed Dec 15, 2023
1 parent 637d5e9 commit 6cc158b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dom/src/dom/dom_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ void DomNode::TransferLayoutOutputsRecursive(std::vector<std::shared_ptr<DomNode

layout_.left = std::isnan(layout_node_->GetLeft()) ? 0 : layout_node_->GetLeft();
layout_.top = std::isnan(layout_node_->GetTop()) ? 0 : layout_node_->GetTop();
layout_.width = std::isnan(layout_node_->GetWidth()) ? 0 : layout_node_->GetWidth();
layout_.height = std::isnan(layout_node_->GetHeight()) ? 0 : layout_node_->GetHeight();
layout_.width = std::isnan(layout_node_->GetWidth()) ? 0 : std::max<float>(layout_node_->GetWidth(), .0);
layout_.height = std::isnan(layout_node_->GetHeight()) ? 0 : std::max<float>(layout_node_->GetHeight(), .0);
layout_.marginLeft = layout_node_->GetMargin(Edge::EdgeLeft);
layout_.marginTop = layout_node_->GetMargin(Edge::EdgeTop);
layout_.marginRight = layout_node_->GetMargin(Edge::EdgeRight);
Expand Down

0 comments on commit 6cc158b

Please sign in to comment.