1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 17:59:24 +01:00

Fixed InputHandler touch states being initialized incorrectly when touch handling is disabled

Closes #10
This commit is contained in:
Ell 2023-12-04 10:20:29 +01:00
parent 764b29e120
commit e191d4919b
2 changed files with 4 additions and 2 deletions

View file

@ -28,6 +28,7 @@ Improvements
Fixes
- Fixed TextInput not working correctly when using surrogate pairs
- Fixed InputHandler touch states being initialized incorrectly when touch handling is disabled
### MLEM.Ui
Additions

View file

@ -121,11 +121,11 @@ namespace MLEM.Input {
/// <summary>
/// Contains the <see cref="LastTouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account.
/// </summary>
public IList<TouchLocation> LastViewportTouchState { get; private set; }
public IList<TouchLocation> LastViewportTouchState { get; private set; } = new List<TouchLocation>();
/// <summary>
/// Contains the <see cref="TouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account.
/// </summary>
public IList<TouchLocation> ViewportTouchState { get; private set; }
public IList<TouchLocation> ViewportTouchState { get; private set; } = new List<TouchLocation>();
/// <summary>
/// Contains the amount of gamepads that are currently connected. Note that this value will be set to 0 if <see cref="HandleGamepads"/> is false.
/// This field is automatically updated in <see cref="Update()"/>.
@ -342,6 +342,7 @@ namespace MLEM.Input {
}
} else {
this.TouchState = new TouchCollection(InputHandler.EmptyTouchLocations);
this.ViewportTouchState = this.TouchState;
this.gestures.Clear();
}