Skip to content

Commit d699d65

Browse files
authored
fix: flutter line height (#78)
1 parent ed06a5c commit d699d65

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/backend/src/flutter/flutterTextBuilder.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,14 @@ export class FlutterTextBuilder extends FlutterDefaultBuilder {
118118
}
119119

120120
lineHeight(lineHeight: LineHeight, fontSize: number): string {
121-
const value = commonLineHeight(lineHeight, fontSize);
122-
if (value) {
123-
return sliceNum(value);
121+
switch (lineHeight.unit) {
122+
case "AUTO":
123+
return "";
124+
case "PIXELS":
125+
return sliceNum(lineHeight.value / fontSize);
126+
case "PERCENT":
127+
return sliceNum(lineHeight.value / 100);
124128
}
125-
return "";
126129
}
127130

128131
letterSpacing(letterSpacing: LetterSpacing, fontSize: number): string {

0 commit comments

Comments
 (0)