Skip to content

Commit

Permalink
feat: avoid redundant null check in PinchGestureRecognizer (#13207)
Browse files Browse the repository at this point in the history
  • Loading branch information
workgroupengineering authored Oct 17, 2023
1 parent ea64024 commit 1ee3779
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using Avalonia.Input.GestureRecognizers;
using Avalonia.Input.GestureRecognizers;

namespace Avalonia.Input
{
Expand Down Expand Up @@ -29,7 +28,7 @@ protected override void PointerCaptureLost(IPointer pointer)

protected override void PointerMoved(PointerEventArgs e)
{
if (Target != null && Target is Visual visual)
if (Target is Visual visual)
{
if(_firstContact == e.Pointer)
{
Expand Down Expand Up @@ -60,7 +59,7 @@ protected override void PointerMoved(PointerEventArgs 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)
{
Expand Down

0 comments on commit 1ee3779

Please sign in to comment.