Browse Source

fix(the bug with first word is space): fix ti

master
wbfsa 5 years ago
parent
commit
6ae83196cb
  1. 2
      src/global/getRowlen.js

2
src/global/getRowlen.js

@ -928,6 +928,7 @@ 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 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); let lastWord = str.substr(str.length-1,1);
if(lastWord==" " || checkWordByteLength(lastWord)==2){ if(lastWord==" " || checkWordByteLength(lastWord)==2){
if(preMeasureText!=null){
spaceOrTwoByte = { spaceOrTwoByte = {
index:i, index:i,
str:preStr, str:preStr,
@ -936,6 +937,7 @@ function getCellTextInfo(cell , ctx, option){
asc:preMeasureText.actualBoundingBoxAscent, asc:preMeasureText.actualBoundingBoxAscent,
desc:preMeasureText.actualBoundingBoxDescent, desc:preMeasureText.actualBoundingBoxDescent,
}; };
}
} }
// textW_all += textW; // textW_all += textW;

Loading…
Cancel
Save