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:
Aakansha Doshi 2023-02-21 12:36:43 +05:30 committed by GitHub
parent 0fcbddda8e
commit 88ff32e9b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 225 additions and 108 deletions

View file

@ -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(