2021-02-08 14:36:12 +01:00
|
|
|
using System;
|
2022-05-22 20:25:11 +02:00
|
|
|
using QuestPDF.Drawing;
|
2021-02-08 14:36:12 +01:00
|
|
|
using QuestPDF.Infrastructure;
|
|
|
|
|
using SkiaSharp;
|
|
|
|
|
|
|
|
|
|
namespace QuestPDF.UnitTests.TestEngine
|
|
|
|
|
{
|
2021-09-18 23:40:21 +02:00
|
|
|
internal class MockCanvas : ICanvas
|
2021-02-08 14:36:12 +01:00
|
|
|
{
|
|
|
|
|
public Action<Position> TranslateFunc { get; set; }
|
2021-09-18 01:03:58 +02:00
|
|
|
public Action<float> RotateFunc { get; set; }
|
|
|
|
|
public Action<float, float> ScaleFunc { get; set; }
|
2021-02-08 14:36:12 +01:00
|
|
|
public Action<SKImage, Position, Size> DrawImageFunc { get; set; }
|
|
|
|
|
public Action<Position, Size, string> DrawRectFunc { get; set; }
|
2021-07-26 11:35:52 +02:00
|
|
|
|
2021-02-08 14:36:12 +01:00
|
|
|
public void Translate(Position vector) => TranslateFunc(vector);
|
2021-09-18 01:03:58 +02:00
|
|
|
public void Rotate(float angle) => RotateFunc(angle);
|
|
|
|
|
public void Scale(float scaleX, float scaleY) => ScaleFunc(scaleX, scaleY);
|
|
|
|
|
|
2021-02-08 14:36:12 +01:00
|
|
|
public void DrawRectangle(Position vector, Size size, string color) => DrawRectFunc(vector, size, color);
|
2022-05-22 20:25:11 +02:00
|
|
|
public void DrawText(SKTextBlob skTextBlob, Position position, TextStyle style) => throw new NotImplementedException();
|
2021-02-08 14:36:12 +01:00
|
|
|
public void DrawImage(SKImage image, Position position, Size size) => DrawImageFunc(image, position, size);
|
2022-02-21 00:57:53 +01:00
|
|
|
|
|
|
|
|
public void DrawHyperlink(string url, Size size) => throw new NotImplementedException();
|
|
|
|
|
public void DrawSectionLink(string sectionName, Size size) => throw new NotImplementedException();
|
|
|
|
|
public void DrawSection(string sectionName) => throw new NotImplementedException();
|
2021-02-08 14:36:12 +01:00
|
|
|
}
|
|
|
|
|
}
|