Skip to content

Commit

Permalink
chore: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Oct 29, 2023
1 parent 6ed543c commit 08f708e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Uno.Toolkit.RuntimeTests/Helpers/ImageAssertHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public static async Task AssertColorAt(this RenderTargetBitmap? bitmap, Color ex
/// <param name="element">The element to take a screenshot of.</param>
public static async Task<RenderTargetBitmap?> TakeScreenshot(this UIElement? element)
{
if (IsScreenshotSupported())
if (element is { } && IsScreenshotSupported())
{
var renderer = new RenderTargetBitmap();
await renderer.RenderAsync(element);
await renderer.RenderAsync(element, (int)element.ActualSize.X, (int)element.ActualSize.Y); // We explicitly set the size to ignore the screen scaling
return renderer;
}
else
Expand Down

0 comments on commit 08f708e

Please sign in to comment.