Enforce a line length limit.

This commit is contained in:
RoosterDragon
2015-03-11 23:57:41 +00:00
parent 721ba5e9c3
commit 1515ac54f6
34 changed files with 156 additions and 57 deletions

View File

@@ -46,7 +46,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
tooltipContainer.BeforeRender = () =>
{
var latencyPrefixSize = latencyPrefix.Bounds.X + latencyPrefixFont.Measure(latencyPrefix.GetText() + " ").X;
var width = Math.Max(locationFont.Measure(location.GetText()).X, Math.Max(adminFont.Measure(admin.GetText()).X, Math.Max(addressFont.Measure(ip.GetText()).X, latencyPrefixSize + latencyFont.Measure(latency.GetText()).X)));
var locationWidth = locationFont.Measure(location.GetText()).X;
var adminWidth = adminFont.Measure(admin.GetText()).X;
var addressWidth = addressFont.Measure(ip.GetText()).X;
var latencyWidth = latencyPrefixSize + latencyFont.Measure(latency.GetText()).X;
var width = Math.Max(locationWidth, Math.Max(adminWidth, Math.Max(addressWidth, latencyWidth)));
widget.Bounds.Width = width + 2 * margin;
latency.Bounds.Width = widget.Bounds.Width;
ip.Bounds.Width = widget.Bounds.Width;