Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TextField.ts #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/egret/text/TextField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,7 @@ namespace egret {
lineCharNum = 0;
}

let old = lineH;
if (values[sys.TextKeys.type] == egret.TextFieldType.INPUT) {
lineH = values[sys.TextKeys.fontSize];
}
Expand Down Expand Up @@ -2195,6 +2196,10 @@ namespace egret {

// w = measureTextWidth(words[k], values, element.style);
if (lineW != 0 && lineW + w > textFieldWidth && lineW + k != 0) {
//如果是首个单词就换行了,那么需要回置lineH
if (k == 0){
lineH = old;
}
break;
}
if (ww + w > textFieldWidth) {//纯英文,一个词就超出宽度的情况
Expand Down