mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CNeutrinoFonts: performance fix
Variable '_height' is reassigned a value before the old one has been used.
This commit is contained in:
@@ -230,13 +230,13 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style)
|
|||||||
|
|
||||||
if (dx == 0) dx = 1280;
|
if (dx == 0) dx = 1280;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (dynFont != NULL)
|
if (dynFont)
|
||||||
delete dynFont;
|
delete dynFont;
|
||||||
dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
|
dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
|
||||||
int _width = 0;
|
|
||||||
int _height = 0;
|
|
||||||
// calculate height & width
|
// calculate height & width
|
||||||
_height = getFontHeight(dynFont);
|
int _width = 0;
|
||||||
|
int _height = getFontHeight(dynFont);;
|
||||||
|
|
||||||
std::string tmpText = text;
|
std::string tmpText = text;
|
||||||
if (text == "") tmpText = "x";
|
if (text == "") tmpText = "x";
|
||||||
_width = dynFont->getRenderWidth(tmpText.c_str());
|
_width = dynFont->getRenderWidth(tmpText.c_str());
|
||||||
@@ -255,7 +255,7 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dynFont != NULL)
|
if (dynFont)
|
||||||
delete dynFont;
|
delete dynFont;
|
||||||
|
|
||||||
return dynSize;
|
return dynSize;
|
||||||
|
Reference in New Issue
Block a user