fix line break issue for 0x0a

This commit is contained in:
houzh 2023-11-27 13:41:51 +08:00
parent 80cd7a5bb0
commit d12baaa580

View File

@ -530,7 +530,7 @@ void Layout::relayout(bool force){
case WORDBREAK_BREAK:{
word.append(1,mText[i]);
measureSize(word,extents);
if(iscntrl(mText[i]))extents.x_advance=0;
if(mText[i]==10)extents.x_advance=0;
const int outofwidth=(total_width + extents.x_advance >mWidth);
if( (( (breaks[0]==WORDBREAK_BREAK) && ( outofwidth && (mBreakStrategy==0) ))||(linebreak==LINEBREAK_MUSTBREAK))){
pushLineData(start,ytop,fontextents.descent,ceil(total_width));