Skip to content

Commit

Permalink
fix scale to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
LinYunMo committed Jun 28, 2023
1 parent fc97493 commit 78ba3a2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cocos/ui/widget-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ function align (node: Node, widget: Widget) {
} else {
x = localRight + (anchorX - 1) * width;
}
width /= scaleX;
if (scaleX !== 0) {
width /= scaleX;
} else {
width = uiTrans.width;
}
}

widget._lastSize.width = width;
Expand Down Expand Up @@ -183,7 +187,11 @@ function align (node: Node, widget: Widget) {
} else {
y = localTop + (anchorY - 1) * height;
}
height /= scaleY;
if (scaleY !== 0) {
height /= scaleY;
} else {
height = uiTrans.height;
}
}

widget._lastSize.height = height;
Expand Down

0 comments on commit 78ba3a2

Please sign in to comment.