Skip to content

Commit

Permalink
fix: TextMeshProUGUI disappears when the Y-axis scale is changed
Browse files Browse the repository at this point in the history
close #295
  • Loading branch information
mob-sakai committed Jan 14, 2025
1 parent 2b44837 commit 8159c09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Packages/src/Runtime/UIEffectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected override void OnEnable()
if (graphic is TextMeshProUGUI)
{
_prevLossyScaleY = transform.lossyScale.y;
UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP;
Canvas.willRenderCanvases += CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP;
}
#endif
Expand All @@ -69,8 +69,8 @@ protected override void OnEnable()
protected override void OnDisable()
{
#if TMP_ENABLE
Canvas.willRenderCanvases -= CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged -= SetVerticesDirtyForTMP;
UIExtraCallbacks.onAfterCanvasRebuild -= CheckSDFScaleForTMP;
#endif

MaterialRepository.Release(ref _material);
Expand Down

0 comments on commit 8159c09

Please sign in to comment.