Skip to content

Commit 796bd4d

Browse files
committed
fixed the bug that scale is NaN if gloader3d is empty
1 parent c2213bf commit 796bd4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Assets/Scripts/UI/GLoader3D.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ virtual protected void FreeExternal()
393393

394394
protected void UpdateLayout()
395395
{
396+
if (sourceWidth == 0 || sourceHeight == 0)
397+
return;
398+
396399
float contentWidth = sourceWidth;
397400
float contentHeight = sourceHeight;
398401

0 commit comments

Comments
 (0)