зеркало из https://github.com/SixLabors/Shapes.git
translate extensions
This commit is contained in:
Родитель
d6efaea442
Коммит
4c0b7f5e3a
|
@ -26,5 +26,16 @@ namespace SixLabors.Shapes
|
|||
{
|
||||
return path.Transform(Matrix3x2.CreateRotation(radians, path.Bounds.Center));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a path translated by the supplied postion
|
||||
/// </summary>
|
||||
/// <param name="path">The path to translate.</param>
|
||||
/// <param name="position">The translation position.</param>
|
||||
/// <returns></returns>
|
||||
public static IPath Translate(this IPath path, Vector2 position)
|
||||
{
|
||||
return path.Transform(Matrix3x2.CreateTranslation(position));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,5 +26,16 @@ namespace SixLabors.Shapes
|
|||
{
|
||||
return shape.Transform(Matrix3x2.CreateRotation(radians, shape.Bounds.Center));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a shape translated by the supplied postion
|
||||
/// </summary>
|
||||
/// <param name="shape">The shape to translate.</param>
|
||||
/// <param name="position">The translation position.</param>
|
||||
/// <returns></returns>
|
||||
public static IShape Translate(this IShape shape, Vector2 position)
|
||||
{
|
||||
return shape.Transform(Matrix3x2.CreateTranslation(position));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче