Skip to content

Commit 8159c09

Browse files
committed
fix: TextMeshProUGUI disappears when the Y-axis scale is changed
close #295
1 parent 2b44837 commit 8159c09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Packages/src/Runtime/UIEffectBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected override void OnEnable()
5656
if (graphic is TextMeshProUGUI)
5757
{
5858
_prevLossyScaleY = transform.lossyScale.y;
59-
UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP;
59+
Canvas.willRenderCanvases += CheckSDFScaleForTMP;
6060
UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP;
6161
}
6262
#endif
@@ -69,8 +69,8 @@ protected override void OnEnable()
6969
protected override void OnDisable()
7070
{
7171
#if TMP_ENABLE
72+
Canvas.willRenderCanvases -= CheckSDFScaleForTMP;
7273
UIExtraCallbacks.onScreenSizeChanged -= SetVerticesDirtyForTMP;
73-
UIExtraCallbacks.onAfterCanvasRebuild -= CheckSDFScaleForTMP;
7474
#endif
7575

7676
MaterialRepository.Release(ref _material);

0 commit comments

Comments
 (0)