mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: logo in dark svg
This commit is contained in:
parent
ab9c85cd2b
commit
8ac95a713b
1 changed files with 5 additions and 1 deletions
|
@ -389,6 +389,7 @@ const addLogoToSvg = (
|
||||||
normalizedCanvasDimensions: Dimensions,
|
normalizedCanvasDimensions: Dimensions,
|
||||||
logoImage: SVGSVGElement,
|
logoImage: SVGSVGElement,
|
||||||
exportScale: number,
|
exportScale: number,
|
||||||
|
theme: AppState["theme"],
|
||||||
) => {
|
) => {
|
||||||
const logoWidth = parseFloat(logoImage.getAttribute("width") || "0");
|
const logoWidth = parseFloat(logoImage.getAttribute("width") || "0");
|
||||||
const logoHeight = parseFloat(logoImage.getAttribute("height") || "0");
|
const logoHeight = parseFloat(logoImage.getAttribute("height") || "0");
|
||||||
|
@ -398,6 +399,9 @@ const addLogoToSvg = (
|
||||||
|
|
||||||
logoImage.setAttribute("x", `${x}`);
|
logoImage.setAttribute("x", `${x}`);
|
||||||
logoImage.setAttribute("y", `${y * exportScale}`);
|
logoImage.setAttribute("y", `${y * exportScale}`);
|
||||||
|
if (theme === THEME.DARK) {
|
||||||
|
logoImage.setAttribute("filter", IMAGE_INVERT_FILTER);
|
||||||
|
}
|
||||||
svgRoot.appendChild(logoImage);
|
svgRoot.appendChild(logoImage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -447,6 +451,6 @@ export const applyFancyBackgroundOnSvg = async ({
|
||||||
const logoImage = await loadSVGElement(
|
const logoImage = await loadSVGElement(
|
||||||
theme === THEME.DARK ? EXPORT_LOGO_URL_DARK : EXPORT_LOGO_URL,
|
theme === THEME.DARK ? EXPORT_LOGO_URL_DARK : EXPORT_LOGO_URL,
|
||||||
);
|
);
|
||||||
addLogoToSvg(svgRoot, dimensions, logoImage, exportScale);
|
addLogoToSvg(svgRoot, dimensions, logoImage, exportScale, theme);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue