Ver Fonte

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

Louis Young há 6 meses atrás
pai
commit
94bdba02d1

+ 3 - 1
packages/plugins/free-container-plugin/src/sub-canvas/components/background/index.tsx

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