Fix Border clip regression (#20648)
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ partial class ServerCompositionVisual
|
||||
_walkContext.PushClip(effectiveClip);
|
||||
|
||||
if (visual.ClipToBounds)
|
||||
_canvas.PushClip(new Rect(0, 0, visual.Size.X, visual.Size.Y));
|
||||
visual.PushClipToBounds(_canvas);
|
||||
|
||||
if (visual.Clip != null)
|
||||
_canvas.PushGeometryClip(visual.Clip);
|
||||
|
||||
@@ -424,5 +424,38 @@ namespace Avalonia.Skia.RenderTests
|
||||
await RenderToFile(target);
|
||||
CompareImages();
|
||||
}
|
||||
|
||||
[Theory,
|
||||
InlineData(true),
|
||||
InlineData(false)]
|
||||
public async Task Border_Clips_To_Round_Bounds(bool uniform)
|
||||
{
|
||||
var cornerRadius = uniform
|
||||
? new CornerRadius(20)
|
||||
: new CornerRadius(20, 10, 30, 5);
|
||||
|
||||
Decorator target = new Decorator
|
||||
{
|
||||
Padding = new Thickness(8),
|
||||
Width = 200,
|
||||
Height = 200,
|
||||
Child = new Border
|
||||
{
|
||||
CornerRadius = cornerRadius,
|
||||
Background = Brushes.LightBlue,
|
||||
ClipToBounds = true,
|
||||
Child = new Border
|
||||
{
|
||||
Width = 300,
|
||||
Height = 300,
|
||||
Background = Brushes.Red,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var testSuffix = nameof(Border_Clips_To_Round_Bounds) + "_" + (uniform ? "Uniform" : "NonUniform");
|
||||
await RenderToFile(target, testSuffix);
|
||||
CompareImages(testSuffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user