Skip to content

Commit

Permalink
fix(HitTest): Check for Clip property for ClippingBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
trungnt2910 committed Sep 24, 2021
1 parent fe05331 commit 97152dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ private static (UIElement? element, Branch? stale) SearchDownForTopMostElementAt
// The maximum region where the current element and its children might draw themselves
// TODO: Get the real clipping rect! For now we assume no clipping.
// This is expressed in element coordinate space.
var clippingBounds = Rect.Infinite;
// For some controls imported from WinUI, such as NavigationView,
// the Clip property may be significant.
var clippingBounds = element.Clip?.Bounds ?? Rect.Infinite;

// The region where the current element draws itself.
// Be aware that children might be out of this rendering bounds if no clipping defined. TODO: .Intersect(clippingBounds)
Expand Down

0 comments on commit 97152dd

Please sign in to comment.