diff --git a/common/changes/@visactor/vtable/1778-bug-tree-mode-with-rowhierarchytextstartalignment-computcolwidth-error_2024-05-23-11-35.json b/common/changes/@visactor/vtable/1778-bug-tree-mode-with-rowhierarchytextstartalignment-computcolwidth-error_2024-05-23-11-35.json new file mode 100644 index 000000000..06bf0fb59 --- /dev/null +++ b/common/changes/@visactor/vtable/1778-bug-tree-mode-with-rowhierarchytextstartalignment-computcolwidth-error_2024-05-23-11-35.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: first col tree mode compute col width error #1778\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file diff --git a/packages/vtable/src/scenegraph/layout/compute-col-width.ts b/packages/vtable/src/scenegraph/layout/compute-col-width.ts index 334db9872..070d2157f 100644 --- a/packages/vtable/src/scenegraph/layout/compute-col-width.ts +++ b/packages/vtable/src/scenegraph/layout/compute-col-width.ts @@ -363,7 +363,7 @@ function computeAutoColWidth( if ((hd as HeaderData)?.define?.columnWidthComputeMode === 'only-body') { continue; } - if ((hd as HeaderData)?.hierarchyLevel) { + if (isValid((hd as HeaderData)?.hierarchyLevel)) { cellHierarchyIndent = ((hd as HeaderData).hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0); if (