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

Commit

Permalink
fix(render): render
Browse files Browse the repository at this point in the history
  • Loading branch information
tubiaoge committed Sep 8, 2020
1 parent 2e40d1f commit 40550d6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/global/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
43 changes: 25 additions & 18 deletions src/global/getRowlen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -462,7 +462,7 @@ function getCellTextInfo(cell , ctx, option){
});
}
}
else{
else{//plain
if(width>cellWidth){

anchor = i-1;
Expand Down Expand Up @@ -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++){
Expand All @@ -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;
Expand Down

0 comments on commit 40550d6

Please sign in to comment.