|
@@ -11,19 +11,23 @@ namespace Avalonia.Rendering.SceneGraph
|
|
|
/// Initializes a new instance of the <see cref="ClipNode"/> class that represents a
|
|
/// Initializes a new instance of the <see cref="ClipNode"/> class that represents a
|
|
|
/// clip push.
|
|
/// clip push.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
|
+ /// <param name="transform">The current transform.</param>
|
|
|
/// <param name="clip">The clip to push.</param>
|
|
/// <param name="clip">The clip to push.</param>
|
|
|
- public ClipNode(Rect clip)
|
|
|
|
|
|
|
+ public ClipNode(Matrix transform, Rect clip)
|
|
|
{
|
|
{
|
|
|
|
|
+ Transform = transform;
|
|
|
Clip = clip;
|
|
Clip = clip;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="ClipNode"/> class that represents a
|
|
/// Initializes a new instance of the <see cref="ClipNode"/> class that represents a
|
|
|
/// clip push.
|
|
/// clip push.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
|
+ /// <param name="transform">The current transform.</param>
|
|
|
/// <param name="clip">The clip to push.</param>
|
|
/// <param name="clip">The clip to push.</param>
|
|
|
- public ClipNode(RoundedRect clip)
|
|
|
|
|
|
|
+ public ClipNode(Matrix transform, RoundedRect clip)
|
|
|
{
|
|
{
|
|
|
|
|
+ Transform = transform;
|
|
|
Clip = clip;
|
|
Clip = clip;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -43,23 +47,31 @@ namespace Avalonia.Rendering.SceneGraph
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
public RoundedRect? Clip { get; }
|
|
public RoundedRect? Clip { get; }
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Gets the transform with which the node will be drawn.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public Matrix Transform { get; }
|
|
|
|
|
+
|
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
|
public bool HitTest(Point p) => false;
|
|
public bool HitTest(Point p) => false;
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Determines if this draw operation equals another.
|
|
/// Determines if this draw operation equals another.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
|
|
+ /// <param name="transform">The transform of the other draw operation.</param>
|
|
|
/// <param name="clip">The clip of the other draw operation.</param>
|
|
/// <param name="clip">The clip of the other draw operation.</param>
|
|
|
/// <returns>True if the draw operations are the same, otherwise false.</returns>
|
|
/// <returns>True if the draw operations are the same, otherwise false.</returns>
|
|
|
/// <remarks>
|
|
/// <remarks>
|
|
|
/// The properties of the other draw operation are passed in as arguments to prevent
|
|
/// The properties of the other draw operation are passed in as arguments to prevent
|
|
|
/// allocation of a not-yet-constructed draw operation object.
|
|
/// allocation of a not-yet-constructed draw operation object.
|
|
|
/// </remarks>
|
|
/// </remarks>
|
|
|
- public bool Equals(RoundedRect? clip) => Clip == clip;
|
|
|
|
|
|
|
+ public bool Equals(Matrix transform, RoundedRect? clip) => Transform == transform && Clip == clip;
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
|
public void Render(IDrawingContextImpl context)
|
|
public void Render(IDrawingContextImpl context)
|
|
|
{
|
|
{
|
|
|
|
|
+ context.Transform = Transform;
|
|
|
|
|
+
|
|
|
if (Clip.HasValue)
|
|
if (Clip.HasValue)
|
|
|
{
|
|
{
|
|
|
context.PushClip(Clip.Value);
|
|
context.PushClip(Clip.Value);
|