cachedWidth is never assigned.

This commit is contained in:
Matthias Mailänder
2020-09-27 10:58:12 +02:00
committed by Paul Chote
parent f13e6fb76d
commit 7a7393b9f0

View File

@@ -29,7 +29,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var font = Game.Renderer.Fonts[label.Font];
var ownerFont = Game.Renderer.Fonts[owner.Font];
var cachedWidth = 0;
var labelText = "";
var showOwner = false;
var flagFaction = "";
@@ -96,12 +95,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var textWidth = Math.Max(font.Measure(labelText).X, font.Measure(extraText).X);
if (textWidth != cachedWidth)
{
label.Bounds.Width = textWidth;
widget.Bounds.Width = 2 * label.Bounds.X + textWidth;
}
label.Bounds.Width = textWidth;
widget.Bounds.Width = 2 * label.Bounds.X + textWidth;
if (showOwner)
{