1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 05:58:35 +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 Fixes
- Fixed TextInput not working correctly when using surrogate pairs - Fixed TextInput not working correctly when using surrogate pairs
- Fixed InputHandler touch states being initialized incorrectly when touch handling is disabled
### MLEM.Ui ### MLEM.Ui
Additions Additions

View file

@ -121,11 +121,11 @@ namespace MLEM.Input {
/// <summary> /// <summary>
/// Contains the <see cref="LastTouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account. /// Contains the <see cref="LastTouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account.
/// </summary> /// </summary>
public IList<TouchLocation> LastViewportTouchState { get; private set; } public IList<TouchLocation> LastViewportTouchState { get; private set; } = new List<TouchLocation>();
/// <summary> /// <summary>
/// Contains the <see cref="TouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account. /// Contains the <see cref="TouchState"/>, but with the <see cref="GraphicsDevice.Viewport"/> taken into account.
/// </summary> /// </summary>
public IList<TouchLocation> ViewportTouchState { get; private set; } public IList<TouchLocation> ViewportTouchState { get; private set; } = new List<TouchLocation>();
/// <summary> /// <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. /// 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()"/>. /// This field is automatically updated in <see cref="Update()"/>.
@ -342,6 +342,7 @@ namespace MLEM.Input {
} }
} else { } else {
this.TouchState = new TouchCollection(InputHandler.EmptyTouchLocations); this.TouchState = new TouchCollection(InputHandler.EmptyTouchLocations);
this.ViewportTouchState = this.TouchState;
this.gestures.Clear(); this.gestures.Clear();
} }