Compare commits

...

2 Commits

Author SHA1 Message Date
zsviczian
3c6dc4fd6d
fixed test 2023-11-18 18:41:47 +01:00
zsviczian
e9ab51c30e
Update textElement.ts
tim spaces at the end of fragments to improve center and right alignment.
2023-11-18 18:32:19 +01:00
2 changed files with 2 additions and 2 deletions

View File

@ -461,7 +461,7 @@ export const wrapText = (text: string, font: FontString, maxWidth: number) => {
const push = (str: string) => { const push = (str: string) => {
if (str.trim()) { if (str.trim()) {
lines.push(str); lines.push(str.trim());
} }
}; };

View File

@ -1173,7 +1173,7 @@ describe("textWysiwyg", () => {
); );
expect((h.elements[1] as ExcalidrawTextElementWithContainer).text).toBe( expect((h.elements[1] as ExcalidrawTextElementWithContainer).text).toBe(
"Online \nwhitebo\nard \ncollabo\nration \nmade \neasy", "Online\nwhitebo\nard\ncollabo\nration\nmade\neasy",
); );
fireEvent.contextMenu(GlobalTestState.interactiveCanvas, { fireEvent.contextMenu(GlobalTestState.interactiveCanvas, {
button: 2, button: 2,