mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: don't push whitespace to next line when exceeding max width during wrapping and make sure to use same width of text editor on DOM when measuring dimensions (#5996)
* fix: don't push whitespace to next line when exceeding max width during wrapping * add a helper function and never push empty line * use width same as in text area so dimensions are same * add tests * make sure dom element has exact same width as text editor
This commit is contained in:
parent
6ab3f0eb74
commit
d2e371cdf0
5 changed files with 67 additions and 23 deletions
|
@ -861,7 +861,7 @@ describe("textWysiwyg", () => {
|
|||
resize(rectangle, "ne", [rectangle.x + 100, rectangle.y - 100]);
|
||||
expect([h.elements[1].x, h.elements[1].y]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
109.5,
|
||||
110.5,
|
||||
17,
|
||||
]
|
||||
`);
|
||||
|
@ -909,7 +909,7 @@ describe("textWysiwyg", () => {
|
|||
resize(rectangle, "ne", [rectangle.x + 100, rectangle.y - 100]);
|
||||
expect([h.elements[1].x, h.elements[1].y]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
424,
|
||||
426,
|
||||
-539,
|
||||
]
|
||||
`);
|
||||
|
@ -1026,7 +1026,7 @@ describe("textWysiwyg", () => {
|
|||
mouse.up(rectangle.x + 100, rectangle.y + 50);
|
||||
expect(rectangle.x).toBe(80);
|
||||
expect(rectangle.y).toBe(85);
|
||||
expect(text.x).toBe(89.5);
|
||||
expect(text.x).toBe(90.5);
|
||||
expect(text.y).toBe(90);
|
||||
|
||||
Keyboard.withModifierKeys({ ctrl: true }, () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue