From be2108f6fea30240e53e103c48a83020e76a6064 Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Tue, 1 Nov 2022 21:49:26 +0100 Subject: [PATCH] Inlined: fixed alignment when in RTL mode --- QuestPDF/Elements/Inlined.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/QuestPDF/Elements/Inlined.cs b/QuestPDF/Elements/Inlined.cs index 051d140..9547504 100644 --- a/QuestPDF/Elements/Inlined.cs +++ b/QuestPDF/Elements/Inlined.cs @@ -146,15 +146,15 @@ namespace QuestPDF.Elements float AlignOffset() { - var difference = availableSpace.Width - lineSize.Width - (lineMeasurements.Count - 1) * HorizontalSpacing; + var emptySpace = availableSpace.Width - lineSize.Width - (lineMeasurements.Count - 1) * HorizontalSpacing; return ElementsAlignment switch { - InlinedAlignment.Left => ContentDirection == ContentDirection.LeftToRight ? 0 : difference, + InlinedAlignment.Left => ContentDirection == ContentDirection.LeftToRight ? 0 : emptySpace, InlinedAlignment.Justify => 0, InlinedAlignment.SpaceAround => elementOffset, - InlinedAlignment.Center => difference / 2, - InlinedAlignment.Right => ContentDirection == ContentDirection.LeftToRight ? difference : 0, + InlinedAlignment.Center => emptySpace / 2, + InlinedAlignment.Right => ContentDirection == ContentDirection.LeftToRight ? emptySpace : 0, _ => 0 }; }