Browse Source

fix(render): render

master
liuyang 5 years ago
parent
commit
40550d6e59
  1. 4
      src/global/draw.js
  2. 43
      src/global/getRowlen.js

4
src/global/draw.js

@ -1178,7 +1178,7 @@ let nullCellRender = function(r, c, start_r, start_c, end_r, end_c,luckysheetTab
}
let cellRender = function(r, c, start_r, start_c, end_r, end_c, value, luckysheetTableContent,af_compute, cf_compute,offsetLeft,offsetTop,dynamicArray_compute,cellOverflowMap, dataset_col_st, dataset_col_ed,scrollHeight,scrollWidth,bodrder05,isMerge){
let cellRender1 = function(r, c, start_r, start_c, end_r, end_c, value, luckysheetTableContent,af_compute, cf_compute,offsetLeft,offsetTop,dynamicArray_compute,cellOverflowMap, dataset_col_st, dataset_col_ed,scrollHeight,scrollWidth,bodrder05,isMerge){
let cell = Store.flowdata[r][c];
let cellWidth = end_c - start_c - 2;
@ -1600,7 +1600,7 @@ let cellRender = function(r, c, start_r, start_c, end_r, end_c, value, luckyshee
}
//非空白单元格渲染
let cellRender1 = function(r, c, start_r, start_c, end_r, end_c, value, luckysheetTableContent,af_compute, cf_compute,offsetLeft,offsetTop,dynamicArray_compute,cellOverflowMap, dataset_col_st, dataset_col_ed,scrollHeight,scrollWidth,bodrder05,isMerge){
let cellRender = function(r, c, start_r, start_c, end_r, end_c, value, luckysheetTableContent,af_compute, cf_compute,offsetLeft,offsetTop,dynamicArray_compute,cellOverflowMap, dataset_col_st, dataset_col_ed,scrollHeight,scrollWidth,bodrder05,isMerge){
let cell = Store.flowdata[r][c];
let cellWidth = end_c - start_c - 2;

43
src/global/getRowlen.js

@ -433,7 +433,7 @@ function getCellTextInfo(cell , ctx, option){
text_all_split[splitIndex]= [];
}
if(rt!=0){
if(rt!=0){//rotate
if(height>cellHeight){
anchor = i-1;
@ -462,7 +462,7 @@ function getCellTextInfo(cell , ctx, option){
});
}
}
else{
else{//plain
if(width>cellWidth){
anchor = i-1;
@ -499,22 +499,27 @@ function getCellTextInfo(cell , ctx, option){
}
// let textH_all_ColumWidth = [];
// for(let i = 0; i < text_all_split.length; i++){
// let splitLen = text_all_split[i];
// let col = splitLen[i], colMaxW=0;
// if(rt!=0){
// }
// for(let c=0;c<col.length;c++){
// let word = col[c];
// colMaxW = Math.max(colMaxW, word.width);
// }
// textH_all_ColumWidth.push(colMaxW);
// textW_all += colMaxW;
// textH_all = Math.max(textH_all, columnHeight);
// }
let split_all_size = [];
for(let i = 0; i <= splitIndex; i++){
let splitLists = text_all_split[i];
let sWidth = 0, sHeight=0;
for(let s=0;s<splitLists.length;s++){
let sp = splitLists[i];
if(rt!=0){//rotate
sWidth += sp.width;
sHeight += sp.height;
}
else{//plain
sWidth += sp.width;
sHeight = Math.max(sHeight, sp.height);
}
}
split_all_size.push({
width:sWidth,
height:sHeight
});
}
let cumColumnWidth = 0;
for(let i = 0; i < text_all_split.length; i++){
@ -524,6 +529,8 @@ function getCellTextInfo(cell , ctx, option){
for(let c=0;c<splitTexts.length;c++){
let wordGroup = splitTexts[c];
let left = space_width + cumColumnWidth;
if(horizonAlign == "0"){
left = cellWidth / 2 + cumColumnWidth - textW_all/2 + space_width*textH_all_ColumnHeight.length;

Loading…
Cancel
Save