From b0fa90b3d6aa16ed9501694d8866add6910ac72b Mon Sep 17 00:00:00 2001 From: ahyang <53590964+zAhYAng@users.noreply.github.com> Date: Sun, 30 Aug 2026 19:05:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(canvas):=20=E8=B0=83=E6=95=B4=E4=BA=AE?= =?UTF-8?q?=E5=85=89=E6=A8=A1=E5=BC=8F=E7=94=BB=E5=B8=83=E8=83=8C=E6=99=AF?= =?UTF-8?q?=20(#354)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/canvas/infinite-canvas.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/components/canvas/infinite-canvas.tsx b/web/src/components/canvas/infinite-canvas.tsx index 29544ebdd..60f30de1c 100644 --- a/web/src/components/canvas/infinite-canvas.tsx +++ b/web/src/components/canvas/infinite-canvas.tsx @@ -41,7 +41,9 @@ type PinchState = { }; export function InfiniteCanvas({ containerRef, viewport, backgroundMode = "lines", onViewportChange, onViewportPreviewChange, onCanvasMouseDown, boxSelectEnabled = false, onCanvasDoubleClick, onCanvasDeselect, onContextMenu, onDrop, onFileDragEnter, onFileDragLeave, onFileDragOver, graphicsLayer, children }: InfiniteCanvasProps) { - const theme = canvasThemes[useThemeStore((state) => state.theme)]; + const colorTheme = useThemeStore((state) => state.theme); + const theme = canvasThemes[colorTheme]; + const canvasBackground = colorTheme === "light" ? "#e6e6e6" : theme.canvas.background; const panState = useRef({ isPanning: false, pointerId: -1, @@ -372,7 +374,7 @@ export function InfiniteCanvas({ containerRef, viewport, backgroundMode = "lines ref={containerRef} className={`relative h-full w-full select-none overflow-hidden touch-none ${isPanning ? "cursor-grabbing" : boxSelectEnabled ? "cursor-crosshair" : "cursor-grab"}`} style={{ - background: theme.canvas.background, + background: canvasBackground, overscrollBehavior: "none", "--canvas-live-x": `${viewport.x}px`, "--canvas-live-y": `${viewport.y}px`,