diff --git a/samples/RenderTest/Pages/ClippingPage.xaml b/samples/RenderTest/Pages/ClippingPage.xaml
index 0e352c4bec..47e9d51e3c 100644
--- a/samples/RenderTest/Pages/ClippingPage.xaml
+++ b/samples/RenderTest/Pages/ClippingPage.xaml
@@ -1,13 +1,15 @@
-
-
+
-
+
+ Apply Geometry Clip
\ No newline at end of file
diff --git a/samples/RenderTest/Pages/ClippingPage.xaml.cs b/samples/RenderTest/Pages/ClippingPage.xaml.cs
index 6c419f245c..b416f12943 100644
--- a/samples/RenderTest/Pages/ClippingPage.xaml.cs
+++ b/samples/RenderTest/Pages/ClippingPage.xaml.cs
@@ -1,3 +1,4 @@
+using System;
using System.Reactive.Linq;
using Avalonia;
using Avalonia.Animation;
@@ -10,10 +11,13 @@ namespace RenderTest.Pages
{
public class ClippingPage : UserControl
{
+ private Geometry _clip;
+
public ClippingPage()
{
InitializeComponent();
CreateAnimations();
+ WireUpCheckbox();
}
private void InitializeComponent()
@@ -23,7 +27,7 @@ namespace RenderTest.Pages
private void CreateAnimations()
{
- var clipped = this.FindControl("geometryClipped");
+ var clipped = this.FindControl("clipChild");
var degrees = Animate.Timer.Select(x => x.TotalMilliseconds / 5);
clipped.RenderTransform = new RotateTransform();
clipped.RenderTransform.Bind(RotateTransform.AngleProperty, degrees, BindingPriority.Animation);
@@ -32,5 +36,13 @@ namespace RenderTest.Pages
clipped.GetObservable(Control.IsPointerOverProperty)
.Select(x => x ? Brushes.Crimson : AvaloniaProperty.UnsetValue));
}
+
+ private void WireUpCheckbox()
+ {
+ var useMask = this.FindControl("useMask");
+ var clipped = this.FindControl("clipped");
+ _clip = clipped.Clip;
+ useMask.Click += (s, e) => clipped.Clip = clipped.Clip == null ? _clip : null;
+ }
}
}