feat(canvas): 画布主题 - 与工作台外观隔离并提高连线对比
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
da0531f6eb
commit
cb405e9b6a
54 files changed
+207
-134
No files matched your search
@@ -11,7 +11,7 @@ import { canvasThemes } from "@/lib/canvas-theme";
|
||||
import { buildEmotionImageArtifacts, buildEmotionPrompt, neutralEmotionPreset, type CanvasEmotionPreset, type CanvasFaceBox } from "@/lib/canvas/canvas-emotion";
|
||||
import { detectCanvasFaces } from "@/lib/canvas/canvas-face-detection";
|
||||
import { subscribeCanvasViewportPreview } from "@/lib/canvas/canvas-live-viewport";
|
||||
import { useThemeStore } from "@/stores/use-theme-store";
|
||||
import { useActiveTheme } from "@/stores/canvas/use-canvas-theme-store";
|
||||
import type { CanvasNodeData, Position, ViewportTransform } from "@/types/canvas";
|
||||
|
||||
type WorkspaceStatus = "detecting" | "selecting" | "manual" | "editing" | "generating" | "error";
|
||||
@@ -193,7 +193,7 @@ function FaceSelectionOverlay({
|
||||
onManualComplete: (box: CanvasFaceBox) => void;
|
||||
onFaceSelect: (box: CanvasFaceBox) => void;
|
||||
}) {
|
||||
const theme = canvasThemes[useThemeStore((state) => state.theme)];
|
||||
const theme = canvasThemes[useActiveTheme()];
|
||||
const overlayRef = useRef<HTMLDivElement>(null);
|
||||
const dragStartRef = useRef<{ x: number; y: number } | null>(null);
|
||||
useScreenAnchor(overlayRef, node, viewport, containerRef, (next) => imageScreenRect(node, next, imageWidth, imageHeight));
|
||||
@@ -352,7 +352,7 @@ function SelectionToolbar({
|
||||
onManualSelect: () => void;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const theme = canvasThemes[useThemeStore((state) => state.theme)];
|
||||
const theme = canvasThemes[useActiveTheme()];
|
||||
const reducedMotion = useReducedMotion();
|
||||
const toolbarRef = useRef<HTMLDivElement>(null);
|
||||
useScreenAnchor(toolbarRef, node, viewport, containerRef, (next, container) => toolbarScreenRect(node, next, container, toolbarRef.current));
|
||||
|
||||
Reference in new issue
Block a user