LayoutTestDrawingCanvas.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System.Numerics;
  2. using QuestPDF.Drawing;
  3. using QuestPDF.Skia;
  4. using QuestPDF.Skia.Text;
  5. namespace QuestPDF.LayoutTests.TestEngine;
  6. internal sealed class LayoutTestDrawingCanvas : IDrawingCanvas
  7. {
  8. private Stack<Matrix4x4> MatrixStack { get; } = new();
  9. private Matrix4x4 CurrentMatrix { get; set; } = Matrix4x4.Identity;
  10. private int CurrentZIndex { get; set; } = 0;
  11. public DocumentPageSnapshot GetSnapshot()
  12. {
  13. return new DocumentPageSnapshot();
  14. }
  15. public void DrawSnapshot(DocumentPageSnapshot snapshot)
  16. {
  17. }
  18. public void Save()
  19. {
  20. MatrixStack.Push(CurrentMatrix);
  21. }
  22. public void Restore()
  23. {
  24. CurrentMatrix = MatrixStack.Pop();
  25. }
  26. public void SetZIndex(int index)
  27. {
  28. CurrentZIndex = index;
  29. }
  30. public int GetZIndex()
  31. {
  32. return CurrentZIndex;
  33. }
  34. public SkCanvasMatrix GetCurrentMatrix()
  35. {
  36. return SkCanvasMatrix.FromMatrix4x4(CurrentMatrix);
  37. }
  38. public void SetMatrix(SkCanvasMatrix matrix)
  39. {
  40. CurrentMatrix = matrix.ToMatrix4x4();
  41. }
  42. public void Translate(Position vector)
  43. {
  44. CurrentMatrix = Matrix4x4.CreateTranslation(vector.X, vector.Y, 0) * CurrentMatrix;
  45. }
  46. public void Scale(float scaleX, float scaleY)
  47. {
  48. CurrentMatrix = Matrix4x4.CreateScale(scaleX, scaleY, 1) * CurrentMatrix;
  49. }
  50. public void Rotate(float angle)
  51. {
  52. CurrentMatrix = Matrix4x4.CreateRotationZ((float)Math.PI * angle / 180f) * CurrentMatrix;
  53. }
  54. public void DrawLine(Position start, Position end, SkPaint paint)
  55. {
  56. }
  57. public void DrawRectangle(Position vector, Size size, SkPaint paint)
  58. {
  59. }
  60. public void DrawComplexBorder(SkRoundedRect innerRect, SkRoundedRect outerRect, SkPaint paint)
  61. {
  62. }
  63. public void DrawShadow(SkRoundedRect shadowRect, SkBoxShadow shadow)
  64. {
  65. }
  66. public void DrawParagraph(SkParagraph paragraph, int lineFrom, int lineTo)
  67. {
  68. }
  69. public void DrawImage(SkImage image, Size size)
  70. {
  71. }
  72. public void DrawPicture(SkPicture picture)
  73. {
  74. }
  75. public void DrawSvgPath(string path, Color color)
  76. {
  77. }
  78. public void DrawSvg(SkSvgImage svgImage, Size size)
  79. {
  80. }
  81. public void DrawOverflowArea(SkRect area)
  82. {
  83. }
  84. public void ClipOverflowArea(SkRect availableSpace, SkRect requiredSpace)
  85. {
  86. }
  87. public void ClipRectangle(SkRect clipArea)
  88. {
  89. }
  90. public void ClipRoundedRectangle(SkRoundedRect clipArea)
  91. {
  92. }
  93. public void DrawHyperlink(Size size, string url, string? description)
  94. {
  95. }
  96. public void DrawSectionLink(Size size, string sectionName, string? description)
  97. {
  98. }
  99. public void DrawSection(string sectionName)
  100. {
  101. }
  102. public void SetSemanticNodeId(int nodeId)
  103. {
  104. }
  105. }