Fixed wrong empty line height
Inverse negative descent to calculate the height of an empty line correctly. Also renamed lineGap to emptyLineHeight to avoid confusion with semantically different lineGap as defined in TrueType etc.
Showing
2 changed files
with
3 additions
and
2 deletions
@@ -283,7 +283,7 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management | @@ -283,7 +283,7 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management | ||
283 | double get descent; | 283 | double get descent; |
284 | 284 | ||
285 | /// Height of an empty line | 285 | /// Height of an empty line |
286 | - double get lineGap => ascent + descent; | 286 | + double get emptyLineHeight => ascent + (-descent); |
287 | 287 | ||
288 | /// Internal units per | 288 | /// Internal units per |
289 | int get unitsPerEm; | 289 | int get unitsPerEm; |
@@ -1073,7 +1073,8 @@ class RichText extends Widget with SpanningWidget { | @@ -1073,7 +1073,8 @@ class RichText extends Widget with SpanningWidget { | ||
1073 | if (spanCount > 0) { | 1073 | if (spanCount > 0) { |
1074 | offsetY += bottom - top; | 1074 | offsetY += bottom - top; |
1075 | } else { | 1075 | } else { |
1076 | - offsetY += font.lineGap * style.fontSize! * textScaleFactor; | 1076 | + offsetY += |
1077 | + font.emptyLineHeight * style.fontSize! * textScaleFactor; | ||
1077 | } | 1078 | } |
1078 | top = 0; | 1079 | top = 0; |
1079 | bottom = 0; | 1080 | bottom = 0; |
-
Please register or login to post a comment