Skip to content

Commit

Permalink
inline GestureLocationData.Invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed Feb 18, 2025
1 parent 1d9b913 commit c4e40ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/Xna.Framework.Input/Input/Touch/GestureLocationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ internal struct GestureLocationData : IEquatable<GestureLocationData>
/// </summary>
internal bool SameFrameReleased;

/// <summary>
/// Helper for assigning an invalid touch location.
/// </summary>
internal static readonly GestureLocationData Invalid = new GestureLocationData();

internal int Id { get { return _id; } }
internal TouchLocationState State { get { return _state; } }
internal Vector2 Position { get { return _position; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ private void UpdateGestures(TimeSpan currentTimestamp, bool stateChanged)
Vector2.Zero, Vector2.Zero));

_pinchGestureStarted = false;
_pinchTouch[0] = GestureLocationData.Invalid;
_pinchTouch[1] = GestureLocationData.Invalid;
_pinchTouch[0] = new GestureLocationData();
_pinchTouch[1] = new GestureLocationData();
break;
}

Expand Down Expand Up @@ -451,8 +451,8 @@ private void UpdateGestures(TimeSpan currentTimestamp, bool stateChanged)
// Make sure a partial pinch state
// is not left hanging around.
_pinchGestureStarted = false;
_pinchTouch[0] = GestureLocationData.Invalid;
_pinchTouch[1] = GestureLocationData.Invalid;
_pinchTouch[0] = new GestureLocationData();
_pinchTouch[1] = new GestureLocationData();
}

// If all points are released then clear some states.
Expand Down

0 comments on commit c4e40ec

Please sign in to comment.