Skip to content

Commit

Permalink
fix(surfacebrush): check that the final size isn't empty before resiz…
Browse files Browse the repository at this point in the history
…ing images.
  • Loading branch information
ramezgerges committed Jun 7, 2024
1 parent 81e55a4 commit 6e98b7b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ internal override void UpdatePaint(SKPaint fillPaint, SKRect bounds)
{
var backgroundArea = GetArrangedImageRect(new Size(scs.Image!.Width, scs.Image.Height), bounds);

if (backgroundArea.Width <= 0 || backgroundArea.Height <= 0)
{
return;
}

// Adding image downscaling in the shader matrix directly is very blurry
// since the default downsampler in Skia is really low quality (but really fast).
// We force Lanczos instead.
Expand Down

0 comments on commit 6e98b7b

Please sign in to comment.