From de03be040ba7da3637be2fe6bece58636cb6f97d Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Tue, 13 Jun 2023 20:28:05 +0800 Subject: [PATCH] fix: add stroke&fill false property --- .../vtable/src/scenegraph/component/custom.ts | 2 ++ .../group-contribution-render.ts | 36 +++++++++++-------- .../cell-type/spark-line-cell.ts | 8 +++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/vtable/src/scenegraph/component/custom.ts b/packages/vtable/src/scenegraph/component/custom.ts index f789d33f1..cf921af47 100644 --- a/packages/vtable/src/scenegraph/component/custom.ts +++ b/packages/vtable/src/scenegraph/component/custom.ts @@ -106,6 +106,8 @@ function adjustElementToGroup( y: 0, width, height, + fill: false, + stroke: false, pickable: false }); customGroup.name = 'custom-container'; diff --git a/packages/vtable/src/scenegraph/graphic/contributions/group-contribution-render.ts b/packages/vtable/src/scenegraph/graphic/contributions/group-contribution-render.ts index 03eb8eb4f..0653cb4db 100644 --- a/packages/vtable/src/scenegraph/graphic/contributions/group-contribution-render.ts +++ b/packages/vtable/src/scenegraph/graphic/contributions/group-contribution-render.ts @@ -13,6 +13,7 @@ import type { Group } from '../group'; import { getCellHoverColor } from '../../../state/hover/is-cell-hover'; import type { BaseTableAPI } from '../../../ts-types/base-table'; import { getPadding } from '../../utils/padding'; +import { getCellMergeInfo } from '../../utils/get-cell-merge'; // const highlightDash: number[] = []; @@ -573,22 +574,27 @@ export class AdjustPosGroupAfterRenderContribution implements IGroupRenderContri !Array.isArray(strokeArrayWidth) && lineWidth & 1 // 奇数线宽 ) { - const table = (group.stage as any).table as BaseTableAPI; - const col = (group as any).col as number; - const row = (group as any).row as number; - - if (table && col === table.colCount - 1) { - width -= 1; - } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) { - width -= 1; + if (group.role === 'cell') { + const table = (group.stage as any).table as BaseTableAPI; + let col = (group as any).col as number; + let row = (group as any).row as number; + const mergeInfo = getCellMergeInfo(table, col, row); + if (mergeInfo) { + col = mergeInfo.end.col; + row = mergeInfo.end.row; + } + + if (table && col === table.colCount - 1) { + width -= 1; + } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) { + width -= 1; + } + if (table && row === table.rowCount - 1) { + height -= 1; + } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) { + height -= 1; + } } - - if (table && row === table.rowCount - 1) { - height -= 1; - } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) { - height -= 1; - } - context.beginPath(); x = Math.floor(x) + 0.5; y = Math.floor(y) + 0.5; diff --git a/packages/vtable/src/scenegraph/group-creater/cell-type/spark-line-cell.ts b/packages/vtable/src/scenegraph/group-creater/cell-type/spark-line-cell.ts index fa110739e..810b72fba 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-type/spark-line-cell.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-type/spark-line-cell.ts @@ -246,7 +246,9 @@ function createChartGroup( x, y, width, - height + height, + stroke: false, + fill: false }); group.name = 'sparkline'; @@ -273,7 +275,9 @@ function createChartGroup( x: 0, y: 0, width, - height + height, + stroke: false, + fill: false }); symbolGroup.name = 'sparkline-symbol-group'; symbolGroup.setTheme({