Reset cached transform on PopEffect (#20474)

This commit is contained in:
Julien Lebosquain
2026-01-15 16:17:07 +01:00
committed by GitHub
parent 737732861b
commit 8215194f32
3 changed files with 40 additions and 2 deletions
@@ -23,7 +23,7 @@ partial class DrawingContextImpl
public void PopEffect()
{
CheckLease();
Canvas.Restore();
RestoreCanvas();
}
SKImageFilter? CreateEffect(IEffect effect)
@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Media;
using Xunit;
#pragma warning disable CS0649
@@ -38,6 +39,43 @@ public class EffectTests : TestBase
await RenderToFile(target);
CompareImages(skipImmediate: true);
}
[Fact]
public async Task EffectFollowedByNonEffect()
{
var target = new Border
{
Background = Brushes.White,
Width = 200,
Height = 200,
Child = new Panel
{
Margin = new Thickness(25),
Children =
{
new Rectangle
{
Fill = Brushes.Yellow,
Effect = new DropShadowEffect
{
Opacity = 1,
OffsetX = 0,
OffsetY = 0,
Color = Colors.Black,
BlurRadius = 50
}
},
new Rectangle
{
Fill = new SolidColorBrush(0x7F007FFF)
}
}
}
};
await RenderToFile(target);
CompareImages(skipImmediate: true);
}
}
#endif
#endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB