diff --git a/common/changes/@visactor/vtable/fix-merge-cell-pos-fs_2024-11-18-13-39.json b/common/changes/@visactor/vtable/fix-merge-cell-pos-fs_2024-11-18-13-39.json new file mode 100644 index 000000000..0ddf8f61b --- /dev/null +++ b/common/changes/@visactor/vtable/fix-merge-cell-pos-fs_2024-11-18-13-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "fix: fix merge cell text position #2858", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 60d71ca66..e5760ab67 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -994,7 +994,15 @@ export function resizeCellGroup( ) { const { col, row } = cellGroup; 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) => { // 利用_dx hack解决掉 合并单元格的范围内的格子依次执行该方法 如果挨个调用updateCell的话 执行多次后dx累计问题