@@ -35,14 +35,11 @@ internal sealed class ApplyReadbackScene : RenderScene
3535
3636 public override string DisplayName => "Apply" ;
3737
38- public override void Paint ( DrawingCanvas < Bgra32 > canvas , Size viewportSize , TimeSpan deltaTime )
38+ public override void Paint ( DrawingCanvas < Bgra32 > canvas , TimeSpan deltaTime )
3939 {
40- if ( viewportSize . Width <= 0 || viewportSize . Height <= 0 )
41- {
42- return ;
43- }
40+ Size viewportSize = canvas . Bounds . Size ;
4441
45- canvas . Fill ( Brushes . Solid ( BackgroundColor ) , new RectangularPolygon ( 0 , 0 , viewportSize . Width , viewportSize . Height ) ) ;
42+ canvas . Fill ( Brushes . Solid ( BackgroundColor ) , canvas . Bounds ) ;
4643 DrawPattern ( canvas , viewportSize ) ;
4744
4845 // Keep both regions tied to the pointer so every movement exercises readback from a different part
@@ -63,7 +60,7 @@ public override void Paint(DrawingCanvas<Bgra32> canvas, Size viewportSize, Time
6360 canvas . Apply ( edgeRegion , ctx => ctx . DetectEdges ( ) ) ;
6461 canvas . Apply ( blurRegion , ctx => ctx . GaussianBlur ( Math . Max ( 3F , Math . Min ( viewportSize . Width , viewportSize . Height ) / 120F ) ) ) ;
6562
66- canvas . Draw ( Pens . Solid ( OutlineColor , 3 ) , new RectangularPolygon ( edgeRegion . X , edgeRegion . Y , edgeRegion . Width , edgeRegion . Height ) ) ;
63+ canvas . Draw ( Pens . Solid ( OutlineColor , 3 ) , new RectangularPolygon ( edgeRegion ) ) ;
6764 canvas . Draw ( Pens . Solid ( OutlineColor , 3 ) , blurRegion ) ;
6865 }
6966
0 commit comments