Browse Source

Adjust asserts in SemanticAwareDrawingCanvas to better handle StyledBox logic

Marcin Ziąbek 1 month ago
parent
commit
429e8ea27b

+ 1 - 1
Source/QuestPDF.ConformanceTests/TestEngine/SemanticAwareDrawingCanvas.cs

@@ -108,7 +108,7 @@ internal class SemanticAwareDrawingCanvas : IDrawingCanvas
 
     public void DrawRectangle(Position vector, Size size, SkPaint paint)
     {
-        if (CurrentSemanticNodeId != SkSemanticNodeSpecialId.BackgroundArtifact)
+        if (CurrentSemanticNodeId is not (SkSemanticNodeSpecialId.BackgroundArtifact or SkSemanticNodeSpecialId.LayoutArtifact))
             Assert.Fail("Detected a rectangle drawing operation outside of layout artifact");
     }