mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: normalize svg using only absolute sizing (#8854)
This commit is contained in:
parent
31e2a0cb4a
commit
b5652b8e36
2 changed files with 36 additions and 12 deletions
|
@ -3870,14 +3870,18 @@ class App extends React.Component<AppProps, AppState> {
|
|||
nextFiles[fileData.id] = fileData;
|
||||
|
||||
if (fileData.mimeType === MIME_TYPES.svg) {
|
||||
const restoredDataURL = getDataURL_sync(
|
||||
normalizeSVG(dataURLToString(fileData.dataURL)),
|
||||
MIME_TYPES.svg,
|
||||
);
|
||||
if (fileData.dataURL !== restoredDataURL) {
|
||||
// bump version so persistence layer can update the store
|
||||
fileData.version = (fileData.version ?? 1) + 1;
|
||||
fileData.dataURL = restoredDataURL;
|
||||
try {
|
||||
const restoredDataURL = getDataURL_sync(
|
||||
normalizeSVG(dataURLToString(fileData.dataURL)),
|
||||
MIME_TYPES.svg,
|
||||
);
|
||||
if (fileData.dataURL !== restoredDataURL) {
|
||||
// bump version so persistence layer can update the store
|
||||
fileData.version = (fileData.version ?? 1) + 1;
|
||||
fileData.dataURL = restoredDataURL;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue