forked from 0ad/0ad
Stop new-line characters making lines longer than they should be.
Reviewed By: Imarok Fixes: #3351 Differential Revision: https://code.wildfiregames.com/D1299 This was SVN commit r21546.
This commit is contained in:
parent
0f86ff6e48
commit
afd69a58b3
@ -78,32 +78,32 @@ var g_SummaryTypes = {
|
||||
"lost": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Lost"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
},
|
||||
"used": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Used"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
},
|
||||
"received": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Received"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
},
|
||||
"sold": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Sold"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
},
|
||||
"outcome": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Outcome"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
},
|
||||
"failed": {
|
||||
"color": g_TypeColors.red,
|
||||
"caption": translate("Failed"),
|
||||
"postfix": "\n"
|
||||
"postfix": ""
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -690,10 +690,14 @@ SGUIText CGUI::GenerateText(const CGUIString& string, const CStrW& FontW, const
|
||||
// Let line_height be the maximum m_Height we encounter.
|
||||
line_height = std::max(line_height, Feedback2.m_Size.cy);
|
||||
|
||||
line_width += Feedback2.m_Size.cx;
|
||||
|
||||
// If the current word is an explicit new line ("\n"),
|
||||
// break now before adding the width of this character.
|
||||
// ("\n" doesn't have a glyph, thus is given the same width as
|
||||
// the "missing glyph" character by CFont::GetCharacterWidth().)
|
||||
if (WordWrapping && Feedback2.m_NewLine)
|
||||
break;
|
||||
|
||||
line_width += Feedback2.m_Size.cx;
|
||||
}
|
||||
|
||||
float dx = 0.f;
|
||||
|
Loading…
Reference in New Issue
Block a user