Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(the bug with first word is space): fix ti
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer committed Oct 21, 2020
1 parent 0282fa0 commit 6ae8319
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/global/getRowlen.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,14 +928,16 @@ function getCellTextInfo(cell , ctx, option){
let height = textWidth * Math.sin(rt*Math.PI/180) + textHeight * Math.cos(rt*Math.PI/180);//consider text box wdith and line height
let lastWord = str.substr(str.length-1,1);
if(lastWord==" " || checkWordByteLength(lastWord)==2){
spaceOrTwoByte = {
index:i,
str:preStr,
width:preTextWidth,
height:preTextHeight,
asc:preMeasureText.actualBoundingBoxAscent,
desc:preMeasureText.actualBoundingBoxDescent,
};
if(preMeasureText!=null){
spaceOrTwoByte = {
index:i,
str:preStr,
width:preTextWidth,
height:preTextHeight,
asc:preMeasureText.actualBoundingBoxAscent,
desc:preMeasureText.actualBoundingBoxDescent,
};
}

}
// textW_all += textW;
Expand Down

0 comments on commit 6ae8319

Please sign in to comment.