diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs index 46624adcc..0fd67b71f 100644 --- a/Subsurface/Source/GUI/GUIComponent.cs +++ b/Subsurface/Source/GUI/GUIComponent.cs @@ -280,13 +280,11 @@ namespace Barotrauma int width = 400; if (toolTipBlock==null || (string)toolTipBlock.userData != ToolTip) { - //string wrappedText = ToolBox.WrapText(ToolTip, width, GUI.SmallFont); toolTipBlock = new GUITextBlock(new Rectangle(0,0,width, 18), ToolTip, GUI.Style, Alignment.TopLeft, Alignment.TopLeft, null, true, GUI.SmallFont); toolTipBlock.padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f); - toolTipBlock.rect.Width = (int)(GUI.SmallFont.MeasureString(toolTipBlock.Text).X + 20); - toolTipBlock.rect.Height = toolTipBlock.Text.Split('\n').Length * 18; + toolTipBlock.rect.Width = (int)(GUI.SmallFont.MeasureString(toolTipBlock.WrappedText).X + 20); + toolTipBlock.rect.Height = toolTipBlock.WrappedText.Split('\n').Length * 18; toolTipBlock.Color = Color.Black * 0.7f; - //toolTipBlock.OutlineColor = Color.White; toolTipBlock.userData = ToolTip; } diff --git a/Subsurface/Source/GUI/GUITextBlock.cs b/Subsurface/Source/GUI/GUITextBlock.cs index be26a2489..e230e0601 100644 --- a/Subsurface/Source/GUI/GUITextBlock.cs +++ b/Subsurface/Source/GUI/GUITextBlock.cs @@ -47,6 +47,11 @@ namespace Barotrauma } } + public string WrappedText + { + get { return wrappedText; } + } + public override Rectangle Rect { get