Skip to content

Commit 0c7092a

Browse files
committed
Fix incorrect sprite size from non squared atlases
1 parent 999f96f commit 0c7092a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: Runtime/TMPImage.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ protected override void OnPopulateMesh(VertexHelper vh)
109109

110110
if (preserveAspect)
111111
{
112-
PreserveSpriteAspectRatio(ref r, uv.size);
112+
var spriteSize = Vector2.Scale(uv.size, new Vector2(texture.width, texture.height));
113+
PreserveSpriteAspectRatio(ref r, spriteSize);
113114
}
114115

115116
var v = new Vector4(r.x, r.y, r.x + r.width, r.y + r.height);

0 commit comments

Comments
 (0)