mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: correct path in SVG exports for production
This commit is contained in:
parent
06ae04c0be
commit
26cd98efb1
2 changed files with 3 additions and 2 deletions
|
@ -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 =
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue