fix(canvas): 画布视觉 - 收敛边框与网格样式

This commit is contained in:
ddCat
2026-08-22 13:09:34 +08:00
parent 772e7bbef7
commit 227e548503
5 changed files with 12 additions and 13 deletions

View File

@@ -70,9 +70,9 @@ export const canvasThemes = {
},
dark: {
canvas: {
background: "#090a0c",
dot: "rgba(174,184,199,.32)",
line: "rgba(174,184,199,.16)",
background: "#0b0b0b",
dot: "rgba(170,170,170,.22)",
line: "rgba(170,170,170,.10)",
selectionFill: "rgba(255,255,255,.12)",
},
node: {

View File

@@ -7,7 +7,7 @@ export const CANVAS_SELECTION_PREVIEW_EVENT = "canvas:selection-preview";
// 空间网格点模式的点半径(像素单位)。远距(缩放 < 0.12)时用更小半径避免糊成一团。
// 同时被 <CanvasGrid>(infinite-canvas)与滚动同步(applyCanvasLiveViewport)共享,避免两处漂移。
export function canvasDotPx(scale: number): string {
return scale < 0.12 ? "1.2px" : "2px";
return scale < 0.12 ? "0.8px" : "1.25px";
}
export function applyCanvasLiveViewport(container: HTMLDivElement | null, viewport: ViewportTransform, notify = true) {