feat: full studio build -- light theme, canvas thumbnails, i18n (fa/en)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { getStudioStage } from "@/lib/studio-canvas-stage";
|
||||
|
||||
/** Wait for Konva to paint after store-driven layer changes */
|
||||
export function scheduleSceneThumbnailCapture(
|
||||
capture: () => void
|
||||
): void {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(capture);
|
||||
});
|
||||
}
|
||||
|
||||
export function captureSceneThumbnailFromStage(): string | null {
|
||||
const stage = getStudioStage();
|
||||
if (!stage) return null;
|
||||
|
||||
try {
|
||||
return stage.toDataURL({ pixelRatio: 0.2 });
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user