Browse Source
feat: avoid redundant null check in PinchGestureRecognizer (#13207)
pull/13229/head
workgroupengineering
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
4 deletions
-
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 |
|
|
|
{ |
|
|
|
@ -29,7 +28,7 @@ namespace Avalonia.Input |
|
|
|
|
|
|
|
protected override void PointerMoved(PointerEventArgs e) |
|
|
|
{ |
|
|
|
if (Target != null && Target is Visual visual) |
|
|
|
if (Target is Visual visual) |
|
|
|
{ |
|
|
|
if(_firstContact == e.Pointer) |
|
|
|
{ |
|
|
|
@ -60,7 +59,7 @@ namespace Avalonia.Input |
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|
|