소스 검색

Inlined: fixed alignment when in RTL mode

MarcinZiabek 3 년 전
부모
커밋
be2108f6fe
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      QuestPDF/Elements/Inlined.cs

+ 4 - 4
QuestPDF/Elements/Inlined.cs

@@ -146,15 +146,15 @@ namespace QuestPDF.Elements
 
 
                 float AlignOffset()
                 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
                     return ElementsAlignment switch
                     {
                     {
-                        InlinedAlignment.Left => ContentDirection == ContentDirection.LeftToRight ? 0 : difference,
+                        InlinedAlignment.Left => ContentDirection == ContentDirection.LeftToRight ? 0 : emptySpace,
                         InlinedAlignment.Justify => 0,
                         InlinedAlignment.Justify => 0,
                         InlinedAlignment.SpaceAround => elementOffset,
                         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
                         _ => 0
                     };
                     };
                 }
                 }