upload images and store them as base64

This commit is contained in:
kbariotis
2020-05-13 21:42:56 +01:00
parent ad81033a78
commit 0cb67a0bc9
9 changed files with 103 additions and 5 deletions
+2 -1
View File
@@ -19,7 +19,7 @@ export function mutateElement<TElement extends Mutable<ExcalidrawElement>>(
) {
// casting to any because can't use `in` operator
// (see https://github.com/microsoft/TypeScript/issues/21732)
const { points } = updates as any;
const { points, imageData } = updates as any;
if (typeof points !== "undefined") {
updates = { ...getSizeFromPoints(points), ...updates };
@@ -36,6 +36,7 @@ export function mutateElement<TElement extends Mutable<ExcalidrawElement>>(
if (
typeof updates.height !== "undefined" ||
typeof updates.width !== "undefined" ||
typeof imageData !== "undefined" ||
typeof points !== "undefined"
) {
invalidateShapeForElement(element);