Skip to content

Commit

Permalink
fix: fix strokeArrayWidth update in updateCell() #2811
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Dec 3, 2024
1 parent 6fee051 commit ad3c2ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix strokeArrayWidth update in updateCell() #2811",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
5 changes: 4 additions & 1 deletion packages/vtable/src/scenegraph/group-creater/cell-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { isArray, isValid } from '@visactor/vutils';
import { breakString } from '../utils/break-string';
import type { CreateRadioCellGroup } from './cell-type/radio-cell';
import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight';
import { getCellBorderStrokeWidth } from '../utils/cell-border-stroke-width';

export function createCell(
type: ColumnTypeOption,
Expand Down Expand Up @@ -527,14 +528,16 @@ export function updateCell(
// update group
const cellWidth = table.getColWidth(col);
const cellHeight = table.getRowHeight(row);
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);

oldCellGroup.setAttributes({
width: cellWidth,
height: cellHeight,
// 背景相关,cell背景由cellGroup绘制
lineWidth: cellTheme?.group?.lineWidth ?? undefined,
fill: cellTheme?.group?.fill ?? undefined,
stroke: cellTheme?.group?.stroke ?? undefined,
strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,
strokeArrayWidth: strokeArrayWidth ?? undefined,
strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,
cursor: (cellTheme?.group as any)?.cursor ?? undefined,
cornerRadius: cellTheme?.group?.cornerRadius ?? 0,
Expand Down

0 comments on commit ad3c2ba

Please sign in to comment.