EllipseGeometryImpl.cs 704 B

12345678910111213141516171819202122232425
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using SkiaSharp;
  4. namespace Avalonia.Skia
  5. {
  6. /// <summary>
  7. /// A Skia implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>.
  8. /// </summary>
  9. internal class EllipseGeometryImpl : GeometryImpl
  10. {
  11. public override Rect Bounds { get; }
  12. public override SKPath EffectivePath { get; }
  13. public EllipseGeometryImpl(Rect rect)
  14. {
  15. var path = new SKPath();
  16. path.AddOval(rect.ToSKRect());
  17. EffectivePath = path;
  18. Bounds = rect;
  19. }
  20. }
  21. }