feat(scenes): add scene darkness reveal and fix project reopen crash
Add darkenScene with Opening brush in presentation, persist reveal strokes per scene during a session, and close projects properly on return to home. Harden dnd asset streaming to avoid Windows main-process crashes when reopening projects. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -90,6 +90,8 @@ export type Scene = {
|
||||
previewVideoAutostart: boolean;
|
||||
/** Поворот превью в градусах (0/90/180/270). */
|
||||
previewRotationDeg: 0 | 90 | 180 | 270;
|
||||
/** В режиме показа: сцена начинается полностью затемнённой; мастер «раскрывает» кистью. */
|
||||
darkenScene: boolean;
|
||||
media: SceneMediaRefs;
|
||||
settings: SceneSettings;
|
||||
connections: SceneId[];
|
||||
|
||||
@@ -8,6 +8,7 @@ export type EffectToolType =
|
||||
| 'sunbeam'
|
||||
| 'poisonCloud'
|
||||
| 'freeze'
|
||||
| 'exploreBrush'
|
||||
| 'eraser';
|
||||
|
||||
export type EffectInstanceType =
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './domain';
|
||||
export * from './effects';
|
||||
export * from './ids';
|
||||
export * from './sceneDarkness';
|
||||
export * from './videoPlayback';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { NPoint } from './effects';
|
||||
|
||||
export type SceneDarknessRevealStroke = {
|
||||
id: string;
|
||||
seed: number;
|
||||
createdAtMs: number;
|
||||
points: NPoint[];
|
||||
radiusN: number;
|
||||
};
|
||||
|
||||
export type SceneDarknessState = {
|
||||
revision: number;
|
||||
/** Текущая сцена помечена «Затемнить сцену» (только для изображений). */
|
||||
enabled: boolean;
|
||||
cacheKey: string | null;
|
||||
strokes: SceneDarknessRevealStroke[];
|
||||
draft: { points: NPoint[]; radiusN: number } | null;
|
||||
};
|
||||
|
||||
export type SceneDarknessEvent =
|
||||
| { kind: 'draft.set'; draft: { points: NPoint[]; radiusN: number } | null }
|
||||
| { kind: 'stroke.add'; stroke: SceneDarknessRevealStroke };
|
||||
Reference in New Issue
Block a user