fix: fix merge cell text position #2858

This commit is contained in:
Rui-Sun 2024-11-18 21:39:55 +08:00
parent 103b5b79f5
commit 72422d2317
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix merge cell text position #2858",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}

View File

@ -994,7 +994,15 @@ export function resizeCellGroup(
) { ) {
const { col, row } = cellGroup; const { col, row } = cellGroup;
const dx = -table.getColsWidth(range.start.col, col - 1); const dx = -table.getColsWidth(range.start.col, col - 1);
const dy = -table.getRowsHeight(range.start.row, row - 1); let dy = 0;
if (table.options.customConfig?._disableColumnAndRowSizeRound) {
// temply fix for fs merge position; bugserverId: 673af513801d3000b3cd9e8f
for (let i = range.start.row; i <= row - 1; i++) {
dy -= table.getRowHeight(i);
}
} else {
dy = -table.getRowsHeight(range.start.row, row - 1);
}
cellGroup.forEachChildren((child: IGraphic) => { cellGroup.forEachChildren((child: IGraphic) => {
// 利用_dx hack解决掉 合并单元格的范围内的格子依次执行该方法 如果挨个调用updateCell的话 执行多次后dx累计问题 // 利用_dx hack解决掉 合并单元格的范围内的格子依次执行该方法 如果挨个调用updateCell的话 执行多次后dx累计问题