From fd9cdfbd089faa9b927f61863b7052953b199266 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Tue, 28 May 2024 20:54:30 +0800 Subject: [PATCH] fix: fix table frame corner radius display problem #1783 --- .../vtable/fix-border-cornor_2024-05-28-12-54.json | 10 ++++++++++ packages/vtable/src/scenegraph/style/frame-border.ts | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 common/changes/@visactor/vtable/fix-border-cornor_2024-05-28-12-54.json diff --git a/common/changes/@visactor/vtable/fix-border-cornor_2024-05-28-12-54.json b/common/changes/@visactor/vtable/fix-border-cornor_2024-05-28-12-54.json new file mode 100644 index 000000000..739fbe6fb --- /dev/null +++ b/common/changes/@visactor/vtable/fix-border-cornor_2024-05-28-12-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "fix: fix table frame corner radius display problem #1783", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file diff --git a/packages/vtable/src/scenegraph/style/frame-border.ts b/packages/vtable/src/scenegraph/style/frame-border.ts index bc6d88797..0919e3e1f 100644 --- a/packages/vtable/src/scenegraph/style/frame-border.ts +++ b/packages/vtable/src/scenegraph/style/frame-border.ts @@ -72,6 +72,7 @@ export function createFrameBorder( if (Array.isArray(borderColor)) { (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any); } + if (Array.isArray(borderLineWidth)) { (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth); (rectAttributes as any).lineWidth = 1; @@ -117,6 +118,9 @@ export function createFrameBorder( rectAttributes.y = borderTop / 2; rectAttributes.pickable = false; if (isTableGroup) { + if (cornerRadius) { + rectAttributes.cornerRadius = cornerRadius + (rectAttributes.lineWidth ?? 0) / 2; + } if (frameTheme.innerBorder) { rectAttributes.x = group.attribute.x + borderLeft / 2; rectAttributes.y = group.attribute.y + borderTop / 2;