feat(control): инструмент «Маркер» на области видимости

Добавлена кисть маркера на пульте и презентации с настройками в панели эффектов; штрихи привязаны к жёлтой рамке, ластик и очистка работают с отдельным сессионным слоем.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-09-02 12:53:06 +08:00
parent 153be98780
commit 8b28a9b11a
18 changed files with 906 additions and 32 deletions
+1
View File
@@ -12,6 +12,7 @@ export type EffectToolType =
| 'freeze'
| 'exploreBrush'
| 'closeBrush'
| 'marker'
| 'eraser';
export type EffectInstanceType =
+1
View File
@@ -9,6 +9,7 @@ export * from './npcDisposition';
export * from './npcExternalUrl';
export * from './npcs';
export * from './sceneDarkness';
export * from './sceneMarker';
export * from './sceneGrid';
export * from './sceneGridSnap';
export * from './tokenPath';
+37
View File
@@ -0,0 +1,37 @@
import type { NPoint } from './effects';
export type SceneMarkerBrushShape = 'circle' | 'square';
export type SceneMarkerStroke = {
id: string;
seed: number;
createdAtMs: number;
points: NPoint[];
radiusN: number;
color: string;
shape?: SceneMarkerBrushShape;
};
export type SceneMarkerDraft = {
points: NPoint[];
radiusN: number;
color: string;
shape?: SceneMarkerBrushShape;
};
export type SceneMarkerState = {
revision: number;
cacheKey: string | null;
strokes: SceneMarkerStroke[];
draft: SceneMarkerDraft | null;
};
export type SceneMarkerEvent =
| { kind: 'draft.set'; draft: SceneMarkerDraft | null }
| { kind: 'stroke.add'; stroke: SceneMarkerStroke }
| { kind: 'strokes.erase'; points: NPoint[]; radiusN: number }
| { kind: 'strokes.clear' };
export function normalizeSceneMarkerBrushShape(raw: unknown): SceneMarkerBrushShape {
return raw === 'square' ? 'square' : 'circle';
}