Skip to content

Commit 20346a9

Browse files
authored
fix: canvas should not have mouse input enabled (#2447)
1 parent 90bce97 commit 20346a9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Intersect.Client.Core/Interface/Interface.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,16 @@ public static void DrawGui()
227227
public static bool DoesMouseHitInterface() => DoesMouseHitComponentOrChildren(sGameCanvas);
228228

229229
[MethodImpl(MethodImplOptions.AggressiveInlining)]
230-
public static bool DoesMouseHitComponentOrChildren(Framework.Gwen.Control.Base component) =>
230+
public static bool DoesMouseHitComponentOrChildren(Framework.Gwen.Control.Base? component) =>
231231
DoesComponentOrChildrenContainMousePoint(component, InputHandler.MousePosition);
232232

233-
public static bool DoesComponentOrChildrenContainMousePoint(Framework.Gwen.Control.Base component, Point position)
233+
public static bool DoesComponentOrChildrenContainMousePoint(Framework.Gwen.Control.Base? component, Point position)
234234
{
235+
if (component == default)
236+
{
237+
return false;
238+
}
239+
235240
if (component.IsHidden)
236241
{
237242
return false;

Intersect.Client.Framework/Gwen/Control/Canvas.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public Canvas(Skin.Base skin, string name) : base(null, name)
4343
BackgroundColor = Color.White;
4444
ShouldDrawBackground = false;
4545
IsTabable = false;
46+
MouseInputEnabled = false;
4647

4748
mDisposeQueue = new List<IDisposable>();
4849
}
@@ -107,7 +108,7 @@ public override void Redraw()
107108
base.Redraw();
108109
}
109110

110-
// Children call parent.GetCanvas() until they get to
111+
// Children call parent.GetCanvas() until they get to
111112
// this top level function.
112113
public override Canvas? GetCanvas()
113114
{

0 commit comments

Comments
 (0)