mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
redraw to correctly position text
This commit is contained in:
parent
cc224b156d
commit
a99ca82389
1 changed files with 3 additions and 26 deletions
|
@ -6,7 +6,7 @@ import { pointFrom, pointRotateRads } from "@excalidraw/math";
|
||||||
|
|
||||||
import { atom, editorJotaiStore, useAtom } from "../editor-jotai";
|
import { atom, editorJotaiStore, useAtom } from "../editor-jotai";
|
||||||
|
|
||||||
import { getElementAbsoluteCoords, refreshTextDimensions } from "../element";
|
import { getElementAbsoluteCoords } from "../element";
|
||||||
import {
|
import {
|
||||||
getFontString,
|
getFontString,
|
||||||
sceneCoordsToViewportCoords,
|
sceneCoordsToViewportCoords,
|
||||||
|
@ -21,10 +21,10 @@ import {
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
computeBoundTextPosition,
|
|
||||||
getBoundTextElement,
|
getBoundTextElement,
|
||||||
getBoundTextMaxHeight,
|
getBoundTextMaxHeight,
|
||||||
getBoundTextMaxWidth,
|
getBoundTextMaxWidth,
|
||||||
|
redrawTextBoundingBox,
|
||||||
} from "../element/textElement";
|
} from "../element/textElement";
|
||||||
import { wrapText } from "../element/textWrapping";
|
import { wrapText } from "../element/textWrapping";
|
||||||
import { measureText } from "../element/textMeasurements";
|
import { measureText } from "../element/textMeasurements";
|
||||||
|
@ -376,30 +376,7 @@ export const adjustBoundTextSize = (
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { x, y } = computeBoundTextPosition(container, boundText, elementsMap);
|
redrawTextBoundingBox(boundText, container, elementsMap, false);
|
||||||
|
|
||||||
mutateElement(
|
|
||||||
boundText,
|
|
||||||
{
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
|
|
||||||
mutateElement(
|
|
||||||
boundText,
|
|
||||||
{
|
|
||||||
...refreshTextDimensions(
|
|
||||||
boundText,
|
|
||||||
container,
|
|
||||||
elementsMap,
|
|
||||||
boundText.originalText,
|
|
||||||
),
|
|
||||||
containerId: container.id,
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const switchShapes = (
|
export const switchShapes = (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue