fix(sub-canvas): background dot fill color (#437)

This commit is contained in:
Louis Young 2025-07-01 18:34:17 +08:00 committed by GitHub
parent 93aa3e77b1
commit 94bdba02d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,9 @@ export const SubCanvasBackground: FC = () => {
const dotColor = backgroundConfig.dotColor ?? '#eceeef'; const dotColor = backgroundConfig.dotColor ?? '#eceeef';
const dotOpacity = backgroundConfig.dotOpacity ?? 0.5; const dotOpacity = backgroundConfig.dotOpacity ?? 0.5;
const backgroundColor = backgroundConfig.backgroundColor ?? '#f2f3f5'; const backgroundColor = backgroundConfig.backgroundColor ?? '#f2f3f5';
const dotFillColor = backgroundConfig.dotFillColor ?? dotColor; // 只有当 dotFillColor 被明确设置且与 dotColor 不同时才添加 fill 属性
const dotFillColor =
backgroundConfig.dotFillColor === dotColor ? '' : backgroundConfig.dotFillColor;
// 生成唯一的 pattern ID // 生成唯一的 pattern ID
const patternId = `sub-canvas-dot-pattern-${node.id}`; const patternId = `sub-canvas-dot-pattern-${node.id}`;