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

View File

@@ -25,6 +25,7 @@ function isElementDraggableFromInside(
): boolean {
const dragFromInside =
element.backgroundColor !== "transparent" ||
element.type === "image" ||
appState.selectedElementIds[element.id];
if (element.type === "line" || element.type === "draw") {
return dragFromInside && isPathALoop(element.points);
@@ -89,7 +90,7 @@ export function hitTest(
);
}
return Math.hypot(a * tx - px, b * ty - py) < lineThreshold;
} else if (element.type === "rectangle") {
} else if (element.type === "rectangle" || element.type === "image") {
if (isElementDraggableFromInside(element, appState)) {
return (
x > x1 - lineThreshold &&