From 1172fd9261db8172421b12b0de237c3ab0fedb78 Mon Sep 17 00:00:00 2001 From: xachary <179740385@qq.com> Date: Thu, 31 Oct 2024 09:08:18 +0800 Subject: [PATCH] fix: fill about graph init --- src/Render/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Render/index.ts b/src/Render/index.ts index b75ad94..6e95052 100644 --- a/src/Render/index.ts +++ b/src/Render/index.ts @@ -580,17 +580,18 @@ export class Render { getAssetSettings(asset?: Konva.Node): Types.AssetSettings { const base = asset?.attrs.assetSettings ?? { ...Render.AssetSettingsDefault } - // 绘制图形,默认不填充 - if (asset?.attrs.assetType === Types.AssetType.Graph) { - base.fill = 'transparent' - } return { // 特定 ...base, // 继承全局 stroke: base.stroke || this.getPageSettings().stroke, strokeWidth: base.strokeWidth || this.getPageSettings().strokeWidth, - fill: base.fill || this.getPageSettings().fill + // 绘制图形,默认不填充 + fill: + base.fill || + (asset?.attrs.assetType === Types.AssetType.Graph + ? 'transparent' + : this.getPageSettings().fill) } }