|
|
|
@ -83,16 +83,8 @@ export const redrawTextBoundingBox = (
|
|
|
|
|
boundTextUpdates.baseline = metrics.baseline;
|
|
|
|
|
|
|
|
|
|
if (container) {
|
|
|
|
|
if (isArrowElement(container)) {
|
|
|
|
|
const centerX = textElement.x + textElement.width / 2;
|
|
|
|
|
const centerY = textElement.y + textElement.height / 2;
|
|
|
|
|
const diffWidth = metrics.width - textElement.width;
|
|
|
|
|
const diffHeight = metrics.height - textElement.height;
|
|
|
|
|
boundTextUpdates.x = centerY - (textElement.height + diffHeight) / 2;
|
|
|
|
|
boundTextUpdates.y = centerX - (textElement.width + diffWidth) / 2;
|
|
|
|
|
} else {
|
|
|
|
|
const containerDims = getContainerDims(container);
|
|
|
|
|
let maxContainerHeight = getMaxContainerHeight(container);
|
|
|
|
|
const maxContainerHeight = getMaxContainerHeight(container);
|
|
|
|
|
|
|
|
|
|
let nextHeight = containerDims.height;
|
|
|
|
|
if (metrics.height > maxContainerHeight) {
|
|
|
|
@ -101,7 +93,6 @@ export const redrawTextBoundingBox = (
|
|
|
|
|
container.type,
|
|
|
|
|
);
|
|
|
|
|
mutateElement(container, { height: nextHeight });
|
|
|
|
|
maxContainerHeight = getMaxContainerHeight(container);
|
|
|
|
|
updateOriginalContainerCache(container.id, nextHeight);
|
|
|
|
|
}
|
|
|
|
|
const updatedTextElement = {
|
|
|
|
@ -112,7 +103,6 @@ export const redrawTextBoundingBox = (
|
|
|
|
|
boundTextUpdates.x = x;
|
|
|
|
|
boundTextUpdates.y = y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mutateElement(textElement, boundTextUpdates);
|
|
|
|
|
};
|
|
|
|
|