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": {
|
"lost": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Lost"),
|
"caption": translate("Lost"),
|
||||||
"postfix": "\n"
|
"postfix": ""
|
||||||
},
|
},
|
||||||
"used": {
|
"used": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Used"),
|
"caption": translate("Used"),
|
||||||
"postfix": "\n"
|
"postfix": ""
|
||||||
},
|
},
|
||||||
"received": {
|
"received": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Received"),
|
"caption": translate("Received"),
|
||||||
"postfix": "\n"
|
"postfix": ""
|
||||||
},
|
},
|
||||||
"sold": {
|
"sold": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Sold"),
|
"caption": translate("Sold"),
|
||||||
"postfix": "\n"
|
"postfix": ""
|
||||||
},
|
},
|
||||||
"outcome": {
|
"outcome": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Outcome"),
|
"caption": translate("Outcome"),
|
||||||
"postfix": "\n"
|
"postfix": ""
|
||||||
},
|
},
|
||||||
"failed": {
|
"failed": {
|
||||||
"color": g_TypeColors.red,
|
"color": g_TypeColors.red,
|
||||||
"caption": translate("Failed"),
|
"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.
|
// Let line_height be the maximum m_Height we encounter.
|
||||||
line_height = std::max(line_height, Feedback2.m_Size.cy);
|
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)
|
if (WordWrapping && Feedback2.m_NewLine)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
line_width += Feedback2.m_Size.cx;
|
||||||
}
|
}
|
||||||
|
|
||||||
float dx = 0.f;
|
float dx = 0.f;
|
||||||
|
Loading…
Reference in New Issue
Block a user