Ticket #723 (new defect)
[PATCH] Multiline centered text
| Reported by: | fcxSanya | Owned by: | |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Backlog |
| Component: | Core engine | Keywords: | |
| Cc: |
Description
Currently text centered by the first line position, so if there is multiple lines, each line will have the same indention as the first one instead of be centered individually.
Attachments
Change History
comment:1 Changed 16 months ago by fcxSanya
- Keywords review added
Attached patch should fix this issue and should allow to properly display multiline centered text.
comment:2 Changed 16 months ago by Philip
I get some minor compiler errors:
../../../source/gui/IGUITextOwner.cpp:123: error: ‘>>’ should be ‘> >’ within a nested template argument list ../../../source/gui/CGUI.cpp:977: error: no matching function for call to ‘min(unsigned int&, size_t)’
On the main menu, if I click the WFG logo in the bottom-left corner it pops up an "About 0 A.D." box. The "0" icon in the centered title bar is incorrectly aligned - presumably something is wrong with the sprite code but I can't tell what...
This seems like a pretty large change to the code - is it really all necessary just to get centered text? I've tried hacking up a much simpler patch to CGUI::DrawText to center all text, which looks like it basically works. Am I missing problems with this approach? (That patch needs some more work to support left-aligned and right-aligned text but that doesn't look hard.)
Changed 16 months ago by Philip
- Attachment multiline-center-2.patch added
alternative approach (incomplete)
