1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-27 02:29:23 +01:00

only handle mouse input if the mouse is in the window

This commit is contained in:
Ell 2021-02-19 02:31:38 +01:00
parent 01b6168259
commit 73eab1d41e

View file

@ -181,7 +181,12 @@ namespace MLEM.Input {
if (this.HandleMouse) {
this.LastMouseState = this.MouseState;
this.MouseState = active ? Mouse.GetState() : default;
this.MouseState = default;
if (active) {
var state = Mouse.GetState();
if (this.Game.GraphicsDevice.Viewport.Bounds.Contains(state.Position))
this.MouseState = state;
}
}
if (this.HandleGamepads) {