IDrawOperation.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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 System;
  4. using Avalonia.Platform;
  5. namespace Avalonia.Rendering.SceneGraph
  6. {
  7. /// <summary>
  8. /// Represents a node in the low-level scene graph that represents geometry.
  9. /// </summary>
  10. public interface IDrawOperation
  11. {
  12. /// <summary>
  13. /// Gets the bounds of the visible content in the node.
  14. /// </summary>
  15. Rect Bounds { get; }
  16. /// <summary>
  17. /// Hit test the geometry in this node.
  18. /// </summary>
  19. /// <param name="p">The point in global coordinates.</param>
  20. /// <returns>True if the point hits the node's geometry; otherwise false.</returns>
  21. /// <remarks>
  22. /// This method does not recurse to child <see cref="IVisualNode"/>s, if you want
  23. /// to hit test children they must be hit tested manually.
  24. /// </remarks>
  25. bool HitTest(Point p);
  26. /// <summary>
  27. /// Renders the node to a drawing context.
  28. /// </summary>
  29. /// <param name="context">The drawing context.</param>
  30. void Render(IDrawingContextImpl context);
  31. }
  32. }