|
|
@ -16,6 +16,7 @@ import {
|
|
|
|
isArrowElement,
|
|
|
|
isArrowElement,
|
|
|
|
isElbowArrow,
|
|
|
|
isElbowArrow,
|
|
|
|
isFrameLikeElement,
|
|
|
|
isFrameLikeElement,
|
|
|
|
|
|
|
|
isImageElement,
|
|
|
|
isTextElement,
|
|
|
|
isTextElement,
|
|
|
|
} from "./typeChecks";
|
|
|
|
} from "./typeChecks";
|
|
|
|
import { getFontString } from "../utils";
|
|
|
|
import { getFontString } from "../utils";
|
|
|
@ -258,6 +259,14 @@ export const dragNewElement = ({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (width !== 0 && height !== 0) {
|
|
|
|
if (width !== 0 && height !== 0) {
|
|
|
|
|
|
|
|
let imageInitialDimension = null;
|
|
|
|
|
|
|
|
if (isImageElement(newElement)) {
|
|
|
|
|
|
|
|
imageInitialDimension = {
|
|
|
|
|
|
|
|
initialWidth: width,
|
|
|
|
|
|
|
|
initialHeight: height,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mutateElement(
|
|
|
|
mutateElement(
|
|
|
|
newElement,
|
|
|
|
newElement,
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -266,6 +275,7 @@ export const dragNewElement = ({
|
|
|
|
width,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
height,
|
|
|
|
...textAutoResize,
|
|
|
|
...textAutoResize,
|
|
|
|
|
|
|
|
...imageInitialDimension,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
informMutation,
|
|
|
|
informMutation,
|
|
|
|
);
|
|
|
|
);
|
|
|
|