|
|
@@ -35,7 +35,9 @@ namespace QuestPDF.UnitTests
|
|
|
})
|
|
|
.MeasureElement(new Size(400, 300))
|
|
|
.ExpectChildMeasure(expectedInput: new Size(400, 300), returns: SpacePlan.PartialRender(200, 100))
|
|
|
+ .ExpectCanvasTranslate(0, 0)
|
|
|
.ExpectChildDraw(new Size(200, 100))
|
|
|
+ .ExpectCanvasTranslate(0, 0)
|
|
|
.CheckDrawResult();
|
|
|
}
|
|
|
|
|
|
@@ -49,7 +51,43 @@ namespace QuestPDF.UnitTests
|
|
|
})
|
|
|
.MeasureElement(new Size(500, 400))
|
|
|
.ExpectChildMeasure(expectedInput: new Size(500, 400), returns: SpacePlan.FullRender(300, 200))
|
|
|
+ .ExpectCanvasTranslate(0, 0)
|
|
|
.ExpectChildDraw(new Size(300, 200))
|
|
|
+ .ExpectCanvasTranslate(0, 0)
|
|
|
+ .CheckDrawResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ [Test]
|
|
|
+ public void Measure_PartialRender_RightToLeft()
|
|
|
+ {
|
|
|
+ TestPlan
|
|
|
+ .For(x => new MinimalBox
|
|
|
+ {
|
|
|
+ Child = x.CreateChild(),
|
|
|
+ ContentDirection = ContentDirection.RightToLeft
|
|
|
+ })
|
|
|
+ .MeasureElement(new Size(400, 300))
|
|
|
+ .ExpectChildMeasure(expectedInput: new Size(400, 300), returns: SpacePlan.PartialRender(200, 100))
|
|
|
+ .ExpectCanvasTranslate(200, 0)
|
|
|
+ .ExpectChildDraw(new Size(200, 100))
|
|
|
+ .ExpectCanvasTranslate(-200, 0)
|
|
|
+ .CheckDrawResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ [Test]
|
|
|
+ public void Measure_FullRender_RightToLeft()
|
|
|
+ {
|
|
|
+ TestPlan
|
|
|
+ .For(x => new MinimalBox
|
|
|
+ {
|
|
|
+ Child = x.CreateChild(),
|
|
|
+ ContentDirection = ContentDirection.RightToLeft
|
|
|
+ })
|
|
|
+ .MeasureElement(new Size(500, 400))
|
|
|
+ .ExpectChildMeasure(expectedInput: new Size(500, 400), returns: SpacePlan.FullRender(350, 200))
|
|
|
+ .ExpectCanvasTranslate(150, 0)
|
|
|
+ .ExpectChildDraw(new Size(350, 200))
|
|
|
+ .ExpectCanvasTranslate(-150, 0)
|
|
|
.CheckDrawResult();
|
|
|
}
|
|
|
}
|