From 26cd98efb19393b0f80707d3b6b7119d56e87177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=C5=A1t=20Pleskot?= Date: Mon, 21 Aug 2023 09:52:48 +0200 Subject: [PATCH] feat: correct path in SVG exports for production --- src/scene/export.ts | 3 +-- src/scene/fancyBackground.ts | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scene/export.ts b/src/scene/export.ts index 3c7908b19..76e070084 100644 --- a/src/scene/export.ts +++ b/src/scene/export.ts @@ -179,8 +179,7 @@ export const exportToSvg = async ( svgRoot.setAttribute("filter", THEME_FILTER); } - // let assetPath = "https://excalidraw.com/"; - let assetPath = "http://localhost:3000/"; + let assetPath = "https://excalidraw.com/"; // Asset path needs to be determined only when using package if (import.meta.env.VITE_IS_EXCALIDRAW_NPM_PACKAGE) { assetPath = diff --git a/src/scene/fancyBackground.ts b/src/scene/fancyBackground.ts index 52a7b3369..c12dc634f 100644 --- a/src/scene/fancyBackground.ts +++ b/src/scene/fancyBackground.ts @@ -193,6 +193,7 @@ export const applyFancyBackgroundOnSvg = async ({ exportScale: AppState["exportScale"]; theme: AppState["theme"]; }) => { + // Image background const fancyBackgroundImageUrl = FANCY_BACKGROUND_IMAGES[fancyBackgroundImageKey][theme]; const fancyBackgroundImage = await loadSVGElement(fancyBackgroundImageUrl); @@ -208,6 +209,7 @@ export const applyFancyBackgroundOnSvg = async ({ svgRoot.appendChild(fancyBackgroundImage); + // Solid color background const rect = svgRoot.ownerDocument!.createElementNS(SVG_NS, "rect"); rect.setAttribute("x", (FANCY_BG_PADDING * exportScale).toString()); rect.setAttribute("y", (FANCY_BG_PADDING * exportScale).toString());