Sfoglia il codice sorgente

Inlined: fixed alignment when in RTL mode

MarcinZiabek 3 anni fa
parent
commit
be2108f6fe
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      QuestPDF/Elements/Inlined.cs

+ 4 - 4
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
                     };
                 }