feat(materials): free rotate session overlays and show save progress
Match NPC drag-to-rotate on the material frame during playback, and change the add/edit Save button to Saving… while import runs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,6 +18,13 @@ function emptyState(): MaterialsOverlayState {
|
||||
};
|
||||
}
|
||||
|
||||
function initialLayout(rotationDeg?: number): MaterialsOverlayLayout {
|
||||
return clampMaterialsLayout({
|
||||
...DEFAULT_MATERIALS_OVERLAY_LAYOUT,
|
||||
rotationDeg: rotationDeg ?? 0,
|
||||
});
|
||||
}
|
||||
|
||||
export class MaterialsOverlayStore {
|
||||
private state: MaterialsOverlayState = emptyState();
|
||||
|
||||
@@ -46,7 +53,7 @@ export class MaterialsOverlayStore {
|
||||
this.state = {
|
||||
revision: this.state.revision + 1,
|
||||
activeMaterialId: event.materialId,
|
||||
layout: { ...DEFAULT_MATERIALS_OVERLAY_LAYOUT },
|
||||
layout: initialLayout(event.rotationDeg),
|
||||
zoomTool: this.state.zoomTool,
|
||||
};
|
||||
return this.state;
|
||||
@@ -57,7 +64,7 @@ export class MaterialsOverlayStore {
|
||||
this.state = {
|
||||
revision: this.state.revision + 1,
|
||||
activeMaterialId: event.materialId,
|
||||
layout: { ...DEFAULT_MATERIALS_OVERLAY_LAYOUT },
|
||||
layout: initialLayout(event.rotationDeg),
|
||||
zoomTool: this.state.zoomTool,
|
||||
};
|
||||
return this.state;
|
||||
@@ -67,7 +74,10 @@ export class MaterialsOverlayStore {
|
||||
this.state = {
|
||||
...this.state,
|
||||
revision: this.state.revision + 1,
|
||||
layout: clampMaterialsLayout(event.layout),
|
||||
layout: clampMaterialsLayout({
|
||||
...this.state.layout,
|
||||
...event.layout,
|
||||
}),
|
||||
};
|
||||
return this.state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user