Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Jul 18, 2024
1 parent c768caf commit bff857c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Avalonia.Svg/AvaloniaPicture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ private static void RecordCommand(CanvasCommand canvasCommand, List<DrawCommand>
commands.Add(new RestoreDrawCommand());
break;
}
case PushMatrixCanvasCommand pushMatrixCanvasCommand:
case SetMatrixCanvasCommand setMatrixCanvasCommand:
{
var matrix = pushMatrixCanvasCommand.DeltaMatrix.ToMatrix();
var matrix = setMatrixCanvasCommand.DeltaMatrix.ToMatrix();
commands.Add(new PushTransformDrawCommand(matrix));
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ShimSkiaSharp/SKCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public record SaveCanvasCommand(int Count) : CanvasCommand;

public record SaveLayerCanvasCommand(int Count, SKPaint? Paint = null) : CanvasCommand;

public record PushMatrixCanvasCommand(SKMatrix DeltaMatrix, SKMatrix TotalMatrix) : CanvasCommand;
public record SetMatrixCanvasCommand(SKMatrix DeltaMatrix, SKMatrix TotalMatrix) : CanvasCommand;

public class SKCanvas
{
Expand Down Expand Up @@ -77,10 +77,10 @@ public void DrawTextOnPath(string text, SKPath path, float hOffset, float vOffse
Commands?.Add(new DrawTextOnPathCanvasCommand(text, path, hOffset, vOffset, paint));
}

public void PushMatrix(SKMatrix deltaMatrix)
public void SetMatrix(SKMatrix deltaMatrix)
{
TotalMatrix = TotalMatrix.PreConcat(deltaMatrix);
Commands?.Add(new PushMatrixCanvasCommand(deltaMatrix, TotalMatrix));
Commands?.Add(new SetMatrixCanvasCommand(deltaMatrix, TotalMatrix));
}

public int Save()
Expand Down
4 changes: 2 additions & 2 deletions src/Svg.CodeGen.Skia/SkiaCSharpModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1778,9 +1778,9 @@ public static void ToSKPicture(this SKPicture? picture, SkiaCSharpCodeGenCounter
sb.AppendLine($"{indent}{counter.CanvasVarName}{counterCanvas}.Restore();");
break;
}
case PushMatrixCanvasCommand pushMatrixCanvasCommand:
case SetMatrixCanvasCommand setMatrixCanvasCommand:
{
sb.AppendLine($"{indent}{counter.CanvasVarName}{counterCanvas}.SetMatrix({pushMatrixCanvasCommand.TotalMatrix.ToSKMatrix()});");
sb.AppendLine($"{indent}{counter.CanvasVarName}{counterCanvas}.SetMatrix({setMatrixCanvasCommand.TotalMatrix.ToSKMatrix()});");
break;
}
case SaveLayerCanvasCommand saveLayerCanvasCommand:
Expand Down
2 changes: 1 addition & 1 deletion src/Svg.Model/Drawables/DrawableBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public virtual void Draw(SKCanvas canvas, DrawAttributes ignoreAttributes, Drawa

if (!Transform.IsIdentity && enableTransform)
{
canvas.PushMatrix(Transform);
canvas.SetMatrix(Transform);
}

if (Clip is { })
Expand Down
2 changes: 1 addition & 1 deletion src/Svg.Model/Drawables/Elements/ImageDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public override void OnDraw(SKCanvas canvas, DrawAttributes ignoreAttributes, Dr
{
canvas.Save();

canvas.PushMatrix(FragmentTransform);
canvas.SetMatrix(FragmentTransform);

FragmentDrawable.Draw(canvas, ignoreAttributes, until, true);

Expand Down
2 changes: 1 addition & 1 deletion src/Svg.Model/Drawables/Elements/TextDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ internal void BeginDraw(SvgTextBase svgTextBase, SKCanvas skCanvas, SKRect skBou

if (!skMatrix.IsIdentity && enableTransform)
{
skCanvas.PushMatrix(skMatrix);
skCanvas.SetMatrix(skMatrix);
}

if (enableClip)
Expand Down
2 changes: 1 addition & 1 deletion src/Svg.Model/SvgExtensions.Painting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ internal static SKPicture RecordPicture(SvgElementCollection svgElementCollectio
var skPictureRecorder = new SKPictureRecorder();
var skCanvas = skPictureRecorder.BeginRecording(skBounds);

skCanvas.PushMatrix(skMatrix);
skCanvas.SetMatrix(skMatrix);

var skPaintOpacity = ignoreAttributes.HasFlag(DrawAttributes.Opacity) ? null : GetOpacityPaint(opacity);
if (skPaintOpacity is { })
Expand Down
4 changes: 2 additions & 2 deletions src/Svg.Skia/SkiaModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,9 +1217,9 @@ public void Draw(CanvasCommand canvasCommand, SkiaSharp.SKCanvas skCanvas)
skCanvas.Restore();
break;
}
case PushMatrixCanvasCommand pushMatrixCanvasCommand:
case SetMatrixCanvasCommand setMatrixCanvasCommand:
{
var matrix = ToSKMatrix(pushMatrixCanvasCommand.TotalMatrix);
var matrix = ToSKMatrix(setMatrixCanvasCommand.TotalMatrix);
skCanvas.SetMatrix(matrix);
break;
}
Expand Down

0 comments on commit bff857c

Please sign in to comment.