File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/webgal/src/Stage/TextBox Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -189,13 +189,13 @@ 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 = userDataState . globalGameVar . Max_line as number ; // config定义字体行数
193- const MaxTextLineHeight = userDataState . globalGameVar . Max_lineHeight as number ; // config 定义字体行数高度
194- const totalHeight = ! Number . isNaN ( Number ( MaxTextLine ) )
195- ? ( Number . isNaN ( Number ( MaxTextLineHeight ) ) ? lineHeightValue : MaxTextLineHeight ) * MaxTextLine
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
196196 : lineHeightValue ; // Max_LineHeight和Max_Line必定为数字,否则使用默认值
197197
198- const lineHeightCssStr = `line-height: ${ totalHeight } em` ;
198+ const lineHeightCssStr = `line-height: ${ finalLineHeight } em` ;
199199 const lhCss = css ( lineHeightCssStr ) ;
200200
201201 return (
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ export const TextBox = () => {
3333 size = getTextSize ( stageState . showTextSize ) + '%' ;
3434 textSizeState = stageState . showTextSize ;
3535 }
36- const MaxTextLine = userDataState . globalGameVar . Max_line as number ; // congfig定义字体行数
37- const lineLimit = Number . isNaN ( Number ( MaxTextLine ) )
36+ const MaxTextLine = Number ( userDataState . globalGameVar . Max_line ) ; // congfig定义字体行数
37+ const lineLimit = Number . isNaN ( MaxTextLine )
3838 ? match ( textSizeState )
3939 . with ( textSize . small , ( ) => 3 )
4040 . with ( textSize . medium , ( ) => 2 )
You can’t perform that action at this time.
0 commit comments