fix: fix a potential ArgumentOutOfRangeException that could occur when changing the FontAsset in TextMeshPro

close #327
This commit is contained in:
mob-sakai
2025-04-07 07:38:37 +09:00
parent 2a900987f5
commit 3b095bcebd
@@ -115,7 +115,8 @@ namespace Coffee.UIEffectInternal
normals.GetOrDefault(i), tangents.GetOrDefault(i));
}
for (var i = 0; i < indexCount - 2; i += 3)
var count = Mathf.Clamp(indexCount, 0, indices.Count);
for (var i = 0; i < count - 2; i += 3)
{
dst.AddTriangle(indices[i], indices[i + 1], indices[i + 2]);
}