Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
442 B

using Avalonia.Controls;
namespace StabilityMatrix.UITests.Extensions;
public static class VisualExtensions
{
public static Rect GetRelativeBounds(this Visual visual, TopLevel topLevel)
{
var origin =
visual.TranslatePoint(new Point(0, 0), topLevel)
?? throw new NullReferenceException("Origin is null");
var bounds = new Rect(origin, visual.Bounds.Size);
return bounds;
}
}