Opened 9 years ago

Last modified 6 years ago

#3351 closed defect

GUI doesn't center text correctly if text has newline — at Initial Version

Reported by: elexis Owned by:
Priority: Should Have Milestone: Alpha 23
Component: Core engine Keywords:
Cc: Patch:

Description

If you have a text element that contains multiple lines (i.e. you assign a string that has \n in it) and if that text element is set to center the text, then the text will not be aligned correctly.

Reproduce by assigning a string like "123\n123" to a text element and make sure it's centered. If you add another newline to the end of the string (i.e. "123\n123\n") then the string will be aligned correctly.

So it seems that there is a trim / whitespace removal missing somewhere in the C++ GUI part.

Example: https://i.imgur.com/rRZ74AM.png

Bug was noticed in #3216.

Change History (2)

by elexis, 9 years ago

Attachment: t3351_reproduce.patch added

Easy way to reproduce the error

by elexis, 7 years ago

Attachment: rRZ74AM.png added
Note: See TracTickets for help on using tickets.