A cross-platform UI framework for .NET
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.
 
 
 

25 lines
658 B

using System;
using System.Collections.Generic;
using System.Text;
namespace Avalonia.Controls
{
internal static class Extensions
{
internal static Point Translate(this Visual fromElement, Visual toElement, Point fromPoint)
{
if (fromElement == toElement)
{
return fromPoint;
}
else
{
var transform = fromElement.TransformToVisual(toElement);
if (transform.HasValue)
return fromPoint.Transform(transform.Value);
else
return fromPoint;
}
}
}
}