Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#3351 closed defect (fixed)

GUI doesn't center text correctly if text has newline

Reported by: elexis Owned by: s0600204
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.

Attachments (2)

t3351_reproduce.patch (1.1 KB ) - added by elexis 9 years ago.
Easy way to reproduce the error
rRZ74AM.png (927.7 KB ) - added by elexis 7 years ago.

Download all attachments as: .zip

Change History (6)

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

comment:3 by s0600204, 6 years ago

Owner: set to s0600204
Resolution: fixed
Status: newclosed

In 21546:

Stop new-line characters making lines longer than they should be.

Reviewed By: Imarok
Fixes: #3351
Differential Revision: https://code.wildfiregames.com/D1299

comment:4 by s0600204, 6 years ago

Milestone: Work In ProgressAlpha 23
Note: See TracTickets for help on using tickets.