mirror of
https://github.com/glest/glest-source.git
synced 2025-09-03 04:52:34 +02:00
- fixed font spacing in chat text
This commit is contained in:
@@ -862,7 +862,14 @@ void Renderer::RenderConsoleLine(int lineIndex, int xPosition, const ConsoleLine
|
|||||||
//printf("playerName [%s], line [%s]\n",playerName.c_str(),line.c_str());
|
//printf("playerName [%s], line [%s]\n",playerName.c_str(),line.c_str());
|
||||||
|
|
||||||
//string headerLine = "*" + playerName + ":";
|
//string headerLine = "*" + playerName + ":";
|
||||||
string headerLine = playerName + ":";
|
string headerLine = playerName + ": ";
|
||||||
|
|
||||||
|
const Metrics &metrics= Metrics::getInstance();
|
||||||
|
const FontMetrics *fontMetrics= CoreData::getInstance().getConsoleFont()->getMetrics();
|
||||||
|
|
||||||
|
if(fontMetrics == NULL) {
|
||||||
|
throw runtime_error("fontMetrics == NULL");
|
||||||
|
}
|
||||||
|
|
||||||
renderTextShadow(
|
renderTextShadow(
|
||||||
headerLine,
|
headerLine,
|
||||||
@@ -871,7 +878,9 @@ void Renderer::RenderConsoleLine(int lineIndex, int xPosition, const ConsoleLine
|
|||||||
xPosition, lineIndex * 20 + 20);
|
xPosition, lineIndex * 20 + 20);
|
||||||
|
|
||||||
fontColor = defaultFontColor;
|
fontColor = defaultFontColor;
|
||||||
xPosition += (8 * (playerName.length() + 2));
|
//xPosition += (8 * (playerName.length() + 2));
|
||||||
|
// Proper font spacing after username portion of chat text rendering
|
||||||
|
xPosition += (metrics.toVirtualX(fontMetrics->getTextWidth(headerLine)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user