Skip to content

Commit

Permalink
Merge pull request #19 from ammarahm-ed/leaf-node-measure-percentage
Browse files Browse the repository at this point in the history
fix leaf measure function not taking nan dim into account
  • Loading branch information
triniwiz committed Feb 17, 2023
2 parents e6f8dd5 + 353c003 commit 8952608
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1932,8 +1932,8 @@ class View @JvmOverloads constructor(
return@let
}

if (widthIsNaN || width.equals(0.0f) && !widthIsZero) {
when (node.style.size.height) {
if (widthIsNaN || (width.equals(0.0f) && !widthIsZero)) {
when (node.style.size.width) {
is Dimension.Points -> {
retWidth = node.style.size.width.value
if (!retWidth.isNaN()) widthIsNaN = false
Expand All @@ -1950,7 +1950,7 @@ class View @JvmOverloads constructor(
}
}

if (heightIsNaN || height.equals(0.0f) && !heightIsZero) {
if (heightIsNaN || (height.equals(0.0f) && !heightIsZero)) {
when (node.style.size.height) {
is Dimension.Points -> {
retHeight = node.style.size.height.value
Expand Down

0 comments on commit 8952608

Please sign in to comment.