feat: save frame as image

This commit is contained in:
Maze Winther
2026-02-23 06:44:27 +01:00
parent 71970d5f5f
commit 5616d4e9f3
3 changed files with 88 additions and 0 deletions
@@ -5,6 +5,7 @@ import {
ContextMenuContent,
ContextMenuItem,
} from "@/components/ui/context-menu";
import { useEditor } from "@/hooks/use-editor";
import { usePreviewStore } from "@/stores/preview-store";
export function PreviewContextMenu({
@@ -14,6 +15,7 @@ export function PreviewContextMenu({
onToggleFullscreen: () => void;
containerRef: React.RefObject<HTMLElement | null>;
}) {
const editor = useEditor();
const { overlays, setOverlayVisibility } = usePreviewStore();
return (
@@ -21,6 +23,9 @@ export function PreviewContextMenu({
<ContextMenuItem onClick={onToggleFullscreen} inset>
Full screen
</ContextMenuItem>
<ContextMenuItem onClick={() => editor.renderer.saveSnapshot()} inset>
Save snapshot
</ContextMenuItem>
<ContextMenuCheckboxItem
checked={overlays.bookmarks}
onCheckedChange={(checked) =>