mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: improve text wrapping in ellipse and alignment (#6172)
* fix: improve text wrapping in ellipse * compute height when font properties updated * fix alignment * fix alignment when resizing * fix * ad padding * always compute height when redrawing bounding box and refactor * lint * fix specs * fix * redraw text bounding box when pasted or refreshed * fix * Add specs * fix * restore on font load * add comments
This commit is contained in:
parent
0fcbddda8e
commit
88ff32e9b3
6 changed files with 225 additions and 108 deletions
|
@ -108,6 +108,7 @@ import {
|
|||
textWysiwyg,
|
||||
transformElements,
|
||||
updateTextElement,
|
||||
redrawTextBoundingBox,
|
||||
} from "../element";
|
||||
import {
|
||||
bindOrUnbindLinearElement,
|
||||
|
@ -264,6 +265,7 @@ import {
|
|||
getBoundTextElement,
|
||||
getContainerCenter,
|
||||
getContainerDims,
|
||||
getContainerElement,
|
||||
getTextBindableContainerAtPosition,
|
||||
isValidTextContainer,
|
||||
} from "../element/textElement";
|
||||
|
@ -1637,6 +1639,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}
|
||||
|
||||
this.scene.replaceAllElements(nextElements);
|
||||
|
||||
nextElements.forEach((nextElement) => {
|
||||
if (isTextElement(nextElement) && isBoundToContainer(nextElement)) {
|
||||
const container = getContainerElement(nextElement);
|
||||
redrawTextBoundingBox(nextElement, container);
|
||||
}
|
||||
});
|
||||
|
||||
this.history.resumeRecording();
|
||||
|
||||
this.setState(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue