Skip to content

Commit

Permalink
chore: fix When_UpdateLayout_In_DragDropping
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Dec 4, 2024
1 parent 0d0902f commit b7d441e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4654,7 +4654,6 @@ public async Task When_UpdateLayout_In_DragDropping()
Content = new TextBlock
{
AllowDrop = true,
CanDrag = true,
Height = 100,
Text = i.ToString()
}
Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Input/GestureRecognizer.Manipulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private enum ManipulationState
public bool IsTranslateYEnabled => _isTranslateYEnabled;
public bool IsRotateEnabled => _isRotateEnabled;
public bool IsScaleEnabled => _isScaleEnabled;
public bool IsDraggingEnabled => _isDraggingEnable;

internal static void AddPointer(GestureRecognizer recognizer, PointerPoint pointer)
{
Expand Down
9 changes: 8 additions & 1 deletion src/Uno.UI/UI/Input/GestureRecognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,19 @@ internal GestureSettings PreventEvents(PointerIdentifier pointerId, GestureSetti
_manipulation?.DisableDragging();
}

var ret = GestureSettings.None;
if (_gestures.TryGetValue(pointerId.Id, out var gesture))
{
gesture.PreventGestures(events);
ret |= gesture.Settings;
}

return _gestureSettings;
if (_manipulation is not null && _manipulation.IsActive(pointerId) && _manipulation.IsDraggingEnabled)
{
ret |= GestureSettings.Drag;
}

return ret;
}

#region Manipulations
Expand Down
4 changes: 4 additions & 0 deletions src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,11 @@ partial void PrepareManagedPointerEventBubbling(RoutedEvent routedEvent, ref Rou
// ptArgs.Pointer.IsInRange && ptArgs.IsPointCoordinatesOver(this) (and probably share it on all platforms).
var isOver = ptArgs.Pointer.IsInRange && (ptArgs.Pointer.PointerDeviceType, ptArgs.Pointer.IsInContact) switch
{
#if HAS_UNO_WINUI
(global::Microsoft.UI.Input.PointerDeviceType.Touch, false) => false,
#else
(PointerDeviceType.Touch, false) => false,
#endif
_ => ptArgs.IsPointCoordinatesOver(this),
};
#endif
Expand Down

0 comments on commit b7d441e

Please sign in to comment.