CurvedTextMeshPro
CurvedTextMeshPro copied to clipboard
Resizing Game View Disables Curvature Transformation
Hey! I love this plugin, but I noticed a bug with the curvature of text resetting. Sometimes I work with just one monitor due to working from a laptop, hence I resize the editor views very frequently. I tried to make my own fix by detected screen size changes. While the changes in size were detected, I attempted to set m_forceUpdate
to true in the Update function in the TextProOnACurve script but this didn't seem to work.
It should be notice I couldn't replicate the bug when switching the Game view to a Simulator view and changing the screen orientation of a simulated device, so it *seems* this is an issue only in the editor. However, I'm unsure if this bug persists in a working build.
Expected Result
Changing the editor game size keeps curve transformation.
Actual Result
Curvature resets on editor game size change.
Steps to Reproduce
- Create a TMP game object on an Overlay UI canvas.
- Create a custom TMP font asset and update the TMP game object to use the custom font asset. (Unsure if this is relevant, just reflecting my working environment..)
- Apply the TextProOnACircle script on the TMP game object.
- With the Game view selected and open in the editor, resize the Game view.
Working Environment
Unity 2021.1.18f1 Unity UI 1.0.0 (August 18 2021 Release)
Gif
You might need to download the gif to view it...
There's a problem using Animation components too. Changing Update
to LateUpdate
on TextProOnACurve appears to fix animation problems. I reckon the issue with both the editor and animation components lies with when TextMeshPro recalculates meshes, although it should be said the LateUpdate change didn't fix the editor bug.