Author Topic: BUG(?): Long line without spaces (like a URL) breaks centering of previous line  (Read 366 times)

CanisLupus

  • Newbie
  • *
  • Posts: 19
Hi there Stephan,

The example project I attached shows this in action.

If you write a long line of text without spaces in a centered and wrapping Text element, so that it wraps around to the next line, the PREVIOUS line (before the long line) gets off-center. The off-center line also doesn't respect the wrap setting until it gets too big itself (so it leaves the field to the right).

Adding a space before the long line (in the same line) seems to fix this behavior but it's not always desired.

We thought it was best to report this, in case it's something you are not aware of, or if you have a better fix.

Cheers,
Daniel Lobo

CanisLupus

  • Newbie
  • *
  • Posts: 19
Additionally, this happens on both Unity 2017.4 (attached) and the previous 2017.3.1, with both paid and free (attached) versions of TextMesh Pro. Our main project where we found this uses the paid version.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5617
I'll try looking into this tomorrow and provide feedback once I have more information.

CanisLupus

  • Newbie
  • *
  • Posts: 19
Just to let you know, this also seems to happen regardless of centering, since we also see it happen with left-aligned text. Essentially, text without spaces that gets broken into several lines breaks the line that precedes it (it adds an empty line between that preceding line and itself).

In this case (left-aligned), adding a space before the line does not fix the problem.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5617
Code: [Select]
Thank you for providing a Repro Project.

I finally had a chance to look into this and this issue has already been fixed in version 1.2.2 of TextMesh Pro which is the latest for Unity 2018.1 available via the Package Manager.

The TMP UPM (Unity Package Manager) package includes a utility tool to convert previous source code and dll only projects to the new format using the "Project Files GUID Remapping Tool". See the following [url=https://forum.unity.com/threads/textmesh-pro-unity-2018-1.511748/]post
for more details.

I suggest you give this a try in the version 1.2.2 to make sure it is behaving as expected for you. I also suggest migrating to this new version.

CanisLupus

  • Newbie
  • *
  • Posts: 19
Hey, thanks for your reply.

Does this mean that the update is only available for Unity 2018.1 and later? We'll not be using that version for a while, especially since it's still in beta and the LTS version of Unity (2017.4) is still to come out and precedes 2018.1.

Is there any equivalent update for 2017.x?

Daniel

PS: We're using the source code version of TMPro, so if the fix is something we can easily add ourselves we could do that.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5617
Hey, thanks for your reply.

Does this mean that the update is only available for Unity 2018.1 and later? We'll not be using that version for a while, especially since it's still in beta and the LTS version of Unity (2017.4) is still to come out and precedes 2018.1.

Is there any equivalent update for 2017.x?

Daniel

PS: We're using the source code version of TMPro, so if the fix is something we can easily add ourselves we could do that.

I'll release a new version of TextMesh Pro this weekend which matches version 1.2.2 of TextMesh Pro available for 2018.1.

CanisLupus

  • Newbie
  • *
  • Posts: 19
Alright, that handles it then. :) Thanks!

CanisLupus

  • Newbie
  • *
  • Posts: 19
Hey Stephan, is the equivalent version already available for 2017.x? Can you please give us a heads up when it is?

Cheers,
Daniel

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5617
Hey Stephan, is the equivalent version already available for 2017.x? Can you please give us a heads up when it is?

Cheers,
Daniel

I should be able to release that new version sometime this week.

CanisLupus

  • Newbie
  • *
  • Posts: 19
Just to let you know that version 1.2.2 indeed fixed the problem for us. Thanks! :)

Daniel

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5617
Just to let you know that version 1.2.2 indeed fixed the problem for us. Thanks! :)

Daniel

:)