feat: separate fancyBackground from renderScene

This commit is contained in:
Arnošt Pleskot 2023-08-10 17:40:29 +02:00
parent 3c56efb9fe
commit d6515e26b9
No known key found for this signature in database
6 changed files with 174 additions and 15 deletions

View file

@ -12,6 +12,7 @@ import {
updateImageCache,
} from "../element/image";
import Scene from "./Scene";
import { applyFancyBackground } from "./fancyBackground";
export const SVG_EXPORT_TAG = `<!-- svg-source:excalidraw -->`;
@ -54,6 +55,14 @@ export const exportToCanvas = async (
const onlyExportingSingleFrame = isOnlyExportingSingleFrame(elements);
if (appState.fancyBackgroundImageUrl) {
await applyFancyBackground(
canvas,
appState.fancyBackgroundImageUrl,
viewBackgroundColor,
);
}
renderStaticScene({
canvas,
rc: rough.canvas(canvas),