From 57e189ee650f51b23763b4b0283e57d34319c086 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 8 Jan 2018 15:51:58 +0200 Subject: [PATCH] Fixed GUITextBoxes being selectable outside their MouseRect (e.g. outside the visible area of a listbox). Closes #220 --- Barotrauma/BarotraumaClient/Source/GUI/GUITextBox.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUITextBox.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUITextBox.cs index b756bd809..321009318 100644 --- a/Barotrauma/BarotraumaClient/Source/GUI/GUITextBox.cs +++ b/Barotrauma/BarotraumaClient/Source/GUI/GUITextBox.cs @@ -216,8 +216,7 @@ namespace Barotrauma { textBlock.Flash(color); } - - //MouseState previousMouse; + public override void Update(float deltaTime) { if (!Visible) return; @@ -225,7 +224,7 @@ namespace Barotrauma if (flashTimer > 0.0f) flashTimer -= deltaTime; if (!Enabled) return; - if (rect.Contains(PlayerInput.MousePosition) && Enabled && + if (MouseRect.Contains(PlayerInput.MousePosition) && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn) || MouseOn.IsParentOf(this))) { state = ComponentState.Hover;