Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Adorner Layer Clipping #13921

Merged
merged 4 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samples/ControlCatalog/Pages/AdornerLayerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
Background="Cyan"
IsHitTestVisible="False"
Opacity="0.3"
IsVisible="True">
IsVisible="True"
AdornerLayer.IsClipEnabled="False">
<Line StartPoint="-10000,0" EndPoint="10000,0" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="-10000,42" EndPoint="10000,42" Stroke="Cyan" StrokeThickness="1" />
<Line StartPoint="0,-10000" EndPoint="0,10000" Stroke="Cyan" StrokeThickness="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public virtual UpdateResult Update(ServerCompositionTarget root)
}

_combinedTransformedClipBounds =
AdornedVisual?._combinedTransformedClipBounds
(AdornerIsClipped ? AdornedVisual?._combinedTransformedClipBounds : null)
?? (Parent?.Effect == null ? Parent?._combinedTransformedClipBounds : null)
?? new Rect(Root!.Size);

Expand Down
1 change: 1 addition & 0 deletions src/Avalonia.Controls/GridSplitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ private void SetupPreviewAdorner()
_resizeData.Adorner = new PreviewAdorner(builtPreviewContent);

AdornerLayer.SetAdornedElement(_resizeData.Adorner, this);
AdornerLayer.SetIsClipEnabled(_resizeData.Adorner, false);

adornerLayer.Children.Add(_resizeData.Adorner);

Expand Down
1 change: 0 additions & 1 deletion src/Avalonia.Controls/Primitives/AdornerLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ private static void AddVisualAdorner(Visual visual, Control? adorner, AdornerLay
}

SetAdornedElement(adorner, visual);
SetIsClipEnabled(adorner, false);

((ISetLogicalParent) adorner).SetParent(visual);
layer.Children.Add(adorner);
Expand Down