|
|
@ -14,6 +14,7 @@ import {
|
|
|
|
isFreeDrawElement,
|
|
|
|
isFreeDrawElement,
|
|
|
|
isInitializedImageElement,
|
|
|
|
isInitializedImageElement,
|
|
|
|
isArrowElement,
|
|
|
|
isArrowElement,
|
|
|
|
|
|
|
|
hasBoundTextElement,
|
|
|
|
} from "../element/typeChecks";
|
|
|
|
} from "../element/typeChecks";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
getDiamondPoints,
|
|
|
|
getDiamondPoints,
|
|
|
@ -41,7 +42,10 @@ import { getStroke, StrokeOptions } from "perfect-freehand";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
getApproxLineHeight,
|
|
|
|
getApproxLineHeight,
|
|
|
|
getBoundTextElement,
|
|
|
|
getBoundTextElement,
|
|
|
|
|
|
|
|
getContainerCoords,
|
|
|
|
getContainerElement,
|
|
|
|
getContainerElement,
|
|
|
|
|
|
|
|
getMaxContainerHeight,
|
|
|
|
|
|
|
|
getMaxContainerWidth,
|
|
|
|
} from "../element/textElement";
|
|
|
|
} from "../element/textElement";
|
|
|
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
|
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
|
|
|
|
|
|
|
|
|
@ -811,6 +815,21 @@ const drawElementFromCanvas = (
|
|
|
|
elementWithCanvas.canvas!.width / elementWithCanvas.canvasZoom,
|
|
|
|
elementWithCanvas.canvas!.width / elementWithCanvas.canvasZoom,
|
|
|
|
elementWithCanvas.canvas!.height / elementWithCanvas.canvasZoom,
|
|
|
|
elementWithCanvas.canvas!.height / elementWithCanvas.canvasZoom,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
process.env.REACT_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX &&
|
|
|
|
|
|
|
|
hasBoundTextElement(element)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
const coords = getContainerCoords(element);
|
|
|
|
|
|
|
|
context.strokeStyle = "#c92a2a";
|
|
|
|
|
|
|
|
context.lineWidth = 3;
|
|
|
|
|
|
|
|
context.strokeRect(
|
|
|
|
|
|
|
|
(coords.x + renderConfig.scrollX) * window.devicePixelRatio,
|
|
|
|
|
|
|
|
(coords.y + renderConfig.scrollY) * window.devicePixelRatio,
|
|
|
|
|
|
|
|
getMaxContainerWidth(element) * window.devicePixelRatio,
|
|
|
|
|
|
|
|
getMaxContainerHeight(element) * window.devicePixelRatio,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
context.restore();
|
|
|
|
context.restore();
|
|
|
|
|
|
|
|
|
|
|
|