fix: rotate bounded text when container is rotated before typing (#4535)
This commit is contained in:
parent
b71e702991
commit
a2e8806f57
@ -163,8 +163,7 @@ export const textWysiwyg = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const [viewportX, viewportY] = getViewportCoords(coordX, coordY);
|
const [viewportX, viewportY] = getViewportCoords(coordX, coordY);
|
||||||
const { textAlign, angle } = updatedElement;
|
const { textAlign } = updatedElement;
|
||||||
|
|
||||||
editable.value = updatedElement.originalText || updatedElement.text;
|
editable.value = updatedElement.originalText || updatedElement.text;
|
||||||
const lines = updatedElement.originalText.split("\n");
|
const lines = updatedElement.originalText.split("\n");
|
||||||
const lineHeight = updatedElement.containerId
|
const lineHeight = updatedElement.containerId
|
||||||
@ -194,6 +193,7 @@ export const textWysiwyg = ({
|
|||||||
? ((appState.zoom.value * 100 - 100) / 10) * 14
|
? ((appState.zoom.value * 100 - 100) / 10) * 14
|
||||||
: 0)) /
|
: 0)) /
|
||||||
appState.zoom.value;
|
appState.zoom.value;
|
||||||
|
const angle = container ? container.angle : updatedElement.angle;
|
||||||
Object.assign(editable.style, {
|
Object.assign(editable.style, {
|
||||||
font: getFontString(updatedElement),
|
font: getFontString(updatedElement),
|
||||||
// must be defined *after* font ¯\_(ツ)_/¯
|
// must be defined *after* font ¯\_(ツ)_/¯
|
||||||
@ -460,6 +460,7 @@ export const textWysiwyg = ({
|
|||||||
width: Number(editable.style.width.slice(0, -2)),
|
width: Number(editable.style.width.slice(0, -2)),
|
||||||
// preserve padding
|
// preserve padding
|
||||||
x: container.x + BOUND_TEXT_PADDING,
|
x: container.x + BOUND_TEXT_PADDING,
|
||||||
|
angle: container.angle,
|
||||||
});
|
});
|
||||||
const boundTextElementId = getBoundTextElementId(container);
|
const boundTextElementId = getBoundTextElementId(container);
|
||||||
if (!boundTextElementId || boundTextElementId !== element.id) {
|
if (!boundTextElementId || boundTextElementId !== element.id) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user