| | |
| | | } |
| | | }) |
| | | |
| | | map.forEach((item, index) => { |
| | | for(let idx = 0;idx < item.length;idx++){ |
| | | let val = item[idx]; |
| | | let cellWidth = val.cellWidth / 40; |
| | | let cellHeight = val.cellHeight / 8; |
| | | |
| | | val.width = cellWidth; |
| | | val.height = cellHeight; |
| | | |
| | | let mergeHeight = cellHeight; |
| | | if(val.rowSpan > 1) { |
| | | for(let i = 1;i < val.rowSpan;i++){ |
| | | let nextMerge = map[index + i][idx]; |
| | | if(nextMerge.type != 'merge'){ |
| | | continue; |
| | | } |
| | | |
| | | let mergeCellHeight = nextMerge.cellHeight / 8; |
| | | mergeHeight += mergeCellHeight; |
| | | } |
| | | |
| | | val.height = mergeHeight; |
| | | } |
| | | |
| | | let mergeWidth = cellWidth; |
| | | if(val.colSpan > 1) { |
| | | for(let i = 1;i < val.colSpan;i++){ |
| | | let nextMerge = map[index][idx + i]; |
| | | if(nextMerge.type != 'merge'){ |
| | | continue; |
| | | } |
| | | |
| | | let mergeCellWidth = nextMerge.cellWidth / 40; |
| | | mergeWidth += mergeCellWidth; |
| | | } |
| | | |
| | | val.width = mergeWidth; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | const rowHeightScaled = bayHeightList.map(h => (h != null && h !== -1) ? (h / 8) : (height)); |
| | | let yOffsets = []; |
| | | let yCursor = 0; |
| | |
| | | let xCursor = 0; |
| | | for (let colIndex = 0; colIndex < row.length; colIndex++) { |
| | | let val = row[colIndex]; |
| | | let cellWidth = val.cellWidth / 40; |
| | | let cellHeight = val.cellHeight / 8; |
| | | |
| | | val.width = cellWidth; |
| | | val.height = cellHeight; |
| | | let cellWidth = val.width; |
| | | let cellHeight = val.height; |
| | | |
| | | val.posX = xCursor; |
| | | val.posY = yOffsets[rowIndex]; |