This commit is contained in:
Zsolt Viczian
2022-03-21 23:08:50 +01:00
parent 23e6e2e33f
commit 1aa092fcc4
12 changed files with 172 additions and 55 deletions

View File

@@ -22,9 +22,14 @@ import ExcalidrawPlugin from "./main";
import {
errorlog,
getDataURL,
getExportTheme,
getFontDataURL,
getImageSize,
getLinkParts,
getSVGPadding,
getWithBackground,
hasExportBackground,
hasExportTheme,
LinkParts,
svgToBase64,
} from "./Utils";
@@ -216,20 +221,26 @@ export class EmbeddedFilesLoader {
const getExcalidrawSVG = async (isDark: boolean) => {
//debug({where:"EmbeddedFileLoader.getExcalidrawSVG",uid:this.uid,file:file.name});
const forceTheme = hasExportTheme(this.plugin,file)
? getExportTheme(this.plugin,file,"light")
: undefined;
const exportSettings: ExportSettings = {
withBackground: false,
withTheme: false,
withBackground: hasExportBackground(this.plugin,file)
? getWithBackground(this.plugin,file)
: false,
withTheme: forceTheme?true:false,
};
const svg = await createSVG(
file.path,
true,
exportSettings,
this,
null,
forceTheme,
null,
null,
[],
this.plugin,
getSVGPadding(this.plugin,file)
);
//https://stackoverflow.com/questions/51154171/remove-css-filter-on-child-elements
const imageList = svg.querySelectorAll(