Skip to content

Commit

Permalink
fix: add stroke&fill false property
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jun 13, 2023
1 parent 1e0b85b commit de03be0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
2 changes: 2 additions & 0 deletions packages/vtable/src/scenegraph/component/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function adjustElementToGroup(
y: 0,
width,
height,
fill: false,
stroke: false,
pickable: false
});
customGroup.name = 'custom-container';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ function createChartGroup(
x,
y,
width,
height
height,
stroke: false,
fill: false
});
group.name = 'sparkline';

Expand All @@ -273,7 +275,9 @@ function createChartGroup(
x: 0,
y: 0,
width,
height
height,
stroke: false,
fill: false
});
symbolGroup.name = 'sparkline-symbol-group';
symbolGroup.setTheme({
Expand Down

0 comments on commit de03be0

Please sign in to comment.