fix(canvas): 调整亮光模式画布背景 (#354)
This commit is contained in:
1 parent
6b341e284e
commit
cfbfde0a59
1 file changed
+4
-2
@@ -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) {
|
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({
|
const panState = useRef({
|
||||||
isPanning: false,
|
isPanning: false,
|
||||||
pointerId: -1,
|
pointerId: -1,
|
||||||
@@ -372,7 +374,7 @@ export function InfiniteCanvas({ containerRef, viewport, backgroundMode = "lines
|
|||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className={`relative h-full w-full select-none overflow-hidden touch-none ${isPanning ? "cursor-grabbing" : boxSelectEnabled ? "cursor-crosshair" : "cursor-grab"}`}
|
className={`relative h-full w-full select-none overflow-hidden touch-none ${isPanning ? "cursor-grabbing" : boxSelectEnabled ? "cursor-crosshair" : "cursor-grab"}`}
|
||||||
style={{
|
style={{
|
||||||
background: theme.canvas.background,
|
background: canvasBackground,
|
||||||
overscrollBehavior: "none",
|
overscrollBehavior: "none",
|
||||||
"--canvas-live-x": `${viewport.x}px`,
|
"--canvas-live-x": `${viewport.x}px`,
|
||||||
"--canvas-live-y": `${viewport.y}px`,
|
"--canvas-live-y": `${viewport.y}px`,
|
||||||
|
|||||||
Reference in new issue
Block a user