Skip to content

Commit df59671

Browse files
committed
feat: merge logical to LineHeight
1 parent 7c71251 commit df59671

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

packages/webgal/src/Stage/TextBox/IMSSTextbox.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,9 @@ export default function IMSSTextbox(props: ITextboxProps) {
189189

190190
const userDataState = useSelector((state: RootState) => state.userData);
191191
const lineHeightValue = textSizeState === textSize.medium ? 2.2 : 2;
192-
const MaxTextLine = Number(userDataState.globalGameVar.Max_line); // config定义字体行数
193-
const MaxTextLineHeight = Number(userDataState.globalGameVar.Max_lineHeight); // config 定义字体行数高度
194-
const finalLineHeight = !Number.isNaN(MaxTextLine)
195-
? (Number.isNaN(MaxTextLineHeight) ? lineHeightValue : MaxTextLineHeight) * MaxTextLine
196-
: lineHeightValue; // Max_LineHeight和Max_Line必定为数字,否则使用默认值
197-
198-
const lineHeightCssStr = `line-height: ${finalLineHeight}em`;
192+
const textLineHeight = userDataState.globalGameVar.LineHeight;
193+
const finalTextLineHeight = textLineHeight ? Number(textLineHeight) : lineHeightValue;
194+
const lineHeightCssStr = `line-height: ${finalTextLineHeight}em`;
199195
const lhCss = css(lineHeightCssStr);
200196

201197
return (

0 commit comments

Comments
 (0)