Skip to content

Commit af7a56f

Browse files
author
noodlefighter
committed
设置行距功能,实现改为修改自动行距的百分比;默认启用(默认值120%)
1 parent 6897403 commit af7a56f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class LabelPlusInputOptions {
6767
font: any; // 设置的字体
6868
fontSize: number; // 字体大小
6969

70-
setTextLeading: boolean;
71-
textLeading: number;
70+
setTextLeading: boolean = true; // 是否设置行距
71+
textLeading: number; // 行距值,百分比
7272

7373
textReplace: string; // 文本替换规则
7474

@@ -1038,12 +1038,10 @@ let newTextLayer = function (
10381038

10391039
textItemRef.contents = text;
10401040

1041-
if (lending == 0) {
1041+
textItemRef.useAutoLeading = true;
1042+
if (lending != 0) {
10421043
textItemRef.useAutoLeading = true;
1043-
}
1044-
else {
1045-
textItemRef.useAutoLeading = false;
1046-
textItemRef.leading = lending;
1044+
textItemRef.autoLeadingAmount = lending;
10471045
}
10481046

10491047
return artLayerRef;

0 commit comments

Comments
 (0)