Browse Source

feat: avoid redundant null check in PinchGestureRecognizer (#13207)

pull/13229/head
workgroupengineering 3 years ago
committed by GitHub
parent
commit
1ee3779a7a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/Avalonia.Base/Input/GestureRecognizers/PinchGestureRecognizer.cs

7
src/Avalonia.Base/Input/GestureRecognizers/PinchGestureRecognizer.cs

@ -1,5 +1,4 @@
using System.Diagnostics; using Avalonia.Input.GestureRecognizers;
using Avalonia.Input.GestureRecognizers;
namespace Avalonia.Input namespace Avalonia.Input
{ {
@ -29,7 +28,7 @@ namespace Avalonia.Input
protected override void PointerMoved(PointerEventArgs e) protected override void PointerMoved(PointerEventArgs e)
{ {
if (Target != null && Target is Visual visual) if (Target is Visual visual)
{ {
if(_firstContact == e.Pointer) if(_firstContact == e.Pointer)
{ {
@ -60,7 +59,7 @@ namespace Avalonia.Input
protected override void PointerPressed(PointerPressedEventArgs e) protected override void PointerPressed(PointerPressedEventArgs e)
{ {
if (Target != null && Target is Visual visual && (e.Pointer.Type == PointerType.Touch || e.Pointer.Type == PointerType.Pen)) if (Target is Visual visual && (e.Pointer.Type == PointerType.Touch || e.Pointer.Type == PointerType.Pen))
{ {
if (_firstContact == null) if (_firstContact == null)
{ {

Loading…
Cancel
Save