From f647905279c5cec1b5f48e2bb533b96a6947ce98 Mon Sep 17 00:00:00 2001 From: alt0 Date: Mon, 10 Oct 2022 18:33:15 +0800 Subject: [PATCH] fix: edgeless pencil color --- libs/components/affine-board/src/hooks/use-shapes.ts | 3 ++- .../src/components/command-panel/BorderColorConfig.tsx | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/components/affine-board/src/hooks/use-shapes.ts b/libs/components/affine-board/src/hooks/use-shapes.ts index d3ff9e028a..d2010ffc76 100644 --- a/libs/components/affine-board/src/hooks/use-shapes.ts +++ b/libs/components/affine-board/src/hooks/use-shapes.ts @@ -109,7 +109,7 @@ export const useShapes = (workspace: string, rootBlockId: string) => { parentId: rootBlockId, ...shapeProps, id: block.id, - style: { ...defaultStyle }, + style: { ...defaultStyle, ...(shapeProps.style || {}) }, workspace, }; } else { @@ -128,6 +128,7 @@ export const useShapes = (workspace: string, rootBlockId: string) => { return acc; }, {} as Record); + console.log('useShapes', blocksShapes); return { shapes: blocksShapes, diff --git a/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx b/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx index 15d6eadc18..eb544869cf 100644 --- a/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx +++ b/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx @@ -35,6 +35,8 @@ const _getIconRenderColor = (shapes: TDShape[]) => { export const BorderColorConfig = ({ app, shapes }: BorderColorConfigProps) => { const setBorderColor = (color: string) => { + console.log('shapes', shapes, color); + app.style({ stroke: color }, getShapeIds(shapes)); };