From c2142c62bb7174a86aa8f40389e8717d00e4907f Mon Sep 17 00:00:00 2001 From: Tom Edwards <109803929+TomEdwardsEnscape@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:28:01 +0200 Subject: [PATCH] Corrected PointerPointProperties inline documentation (#19062) Made PointerEventArgs.Properties public, to better support pattern matching --- src/Avalonia.Base/Input/PointerEventArgs.cs | 4 +-- src/Avalonia.Base/Input/PointerPoint.cs | 34 +++++++++------------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Avalonia.Base/Input/PointerEventArgs.cs b/src/Avalonia.Base/Input/PointerEventArgs.cs index 46c8bb6b15..bbcc5cccd8 100644 --- a/src/Avalonia.Base/Input/PointerEventArgs.cs +++ b/src/Avalonia.Base/Input/PointerEventArgs.cs @@ -143,9 +143,9 @@ namespace Avalonia.Input } /// - /// Returns the current pointer point properties + /// Gets the state the pointer device had when this event occurred. /// - protected PointerPointProperties Properties => _properties; + public PointerPointProperties Properties => _properties; } public enum MouseButton diff --git a/src/Avalonia.Base/Input/PointerPoint.cs b/src/Avalonia.Base/Input/PointerPoint.cs index 5ae7005e5f..941ef587bd 100644 --- a/src/Avalonia.Base/Input/PointerPoint.cs +++ b/src/Avalonia.Base/Input/PointerPoint.cs @@ -31,7 +31,7 @@ namespace Avalonia.Input } /// - /// Provides extended properties for a PointerPoint object. + /// Describes the state of a pointer device when it generated a specific input. /// public record struct PointerPointProperties { @@ -41,47 +41,47 @@ namespace Avalonia.Input public Rect ContactRect { get; } /// - /// Gets a value that indicates whether the pointer input was triggered by the primary action mode of an input device. + /// Gets whether the device's primary action (e.g. ) was active when this input occurred. /// public bool IsLeftButtonPressed { get; } = false; /// - /// Gets a value that indicates whether the pointer input was triggered by the tertiary action mode of an input device. + /// Gets whether the device's tertiary action (e.g. ) was active when this input occurred. /// public bool IsMiddleButtonPressed { get; } = false; /// - /// Gets a value that indicates whether the pointer input was triggered by the secondary action mode (if supported) of an input device. + /// Gets whether the device's secondary action (e.g. ) was active when this input occurred. /// public bool IsRightButtonPressed { get; } = false; /// - /// Gets a value that indicates whether the pointer input was triggered by the first extended mouse button (XButton1). + /// Gets whether the device's first extended action (e.g. ) was active when this input occurred. /// public bool IsXButton1Pressed { get; } = false; /// - /// Gets a value that indicates whether the pointer input was triggered by the second extended mouse button (XButton2). + /// Gets whether the device's second extended action (e.g. ) was active when this input occurred. /// public bool IsXButton2Pressed { get; } = false; /// - /// Gets a value that indicates whether the barrel button of the pen/stylus device is pressed. + /// Gets whether the barrel button of the pen/stylus device was pressed when this input occurred. /// public bool IsBarrelButtonPressed { get; } = false; /// - /// Gets a value that indicates whether the input is from a pen eraser. + /// Gets whether the input was generated by the use of a pen eraser. /// public bool IsEraser { get; } = false; /// - /// Gets a value that indicates whether the digitizer pen is inverted. + /// Gets whether the input was generated by an inverted digitizer pen. /// public bool IsInverted { get; } = false; /// - /// Gets the clockwise rotation in degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers). + /// Gets the clockwise rotation in degrees of the pen around its own major axis (such as when the user spins the pen in their fingers) when this input occurred. /// /// /// A value between 0.0 and 359.0 in degrees of rotation. The default value is 0.0. @@ -89,7 +89,7 @@ namespace Avalonia.Input public float Twist { get; } = 0.0F; /// - /// Gets a value that indicates the force that the pointer device (typically a pen/stylus) exerts on the surface of the digitizer. + /// Gets the force that the pointer device (typically a pen/stylus) was exerting on the surface of the digitizer when this input occurred. /// /// /// A value from 0 to 1.0. The default value is 0.5. @@ -97,23 +97,17 @@ namespace Avalonia.Input public float Pressure { get; } = 0.5f; /// - /// Gets the plane angle between the Y-Z plane and the plane that contains the Y axis and the axis of the input device (typically a pen/stylus). + /// Gets how many degrees of rotation the pen/stylus was tilted left (negative values) or right (positive values) when this input occurred. /// - /// - /// The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted to the right of perpendicular, and between 0.0 and -90.0 when tilted to the left of perpendicular. The default value is 0.0. - /// public float XTilt { get; } = 0.0F; /// - /// Gets the plane angle between the X-Z plane and the plane that contains the X axis and the axis of the input device (typically a pen/stylus). + /// Gets how many degrees of rotation the pen/stylus was tilted up (negative values) or down (positive values) when this input occurred. /// - /// - /// The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted towards the user, and between 0.0 and -90.0 when tilted away from the user. The default value is 0.0. - /// public float YTilt { get; } = 0.0F; /// - /// Gets the kind of pointer state change. + /// Gets the state change that triggered this input. This is typically a button press or release. /// public PointerUpdateKind PointerUpdateKind { get; } = PointerUpdateKind.LeftButtonPressed;