Opened 9 years ago

Last modified 6 years ago

#3351 closed defect

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

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

Description (last modified by elexis)

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.

http://trac.wildfiregames.com/raw-attachment/ticket/3351/rRZ74AM.png

Bug was noticed in #3216.

Change History (4)

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

comment:1 by elexis, 7 years ago

Description: modified (diff)

This bug can also be observed with the FPS counter / ingame time / realtime / ceasefire counter in the top right corner.

comment:2 by elexis, 6 years ago

Description: modified (diff)
Milestone: BacklogWork In Progress
Patch: Phab:D1299
Note: See TracTickets for help on using tickets.