-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix js crash while trying to justify empty lines (#3570)
* Fix js crash while trying to justify empty lines There is no need to justify empty lines. If we have a text that contains multiple empty lines in the middle, JS crashes in `justifyLine` function. The `start` glyph index is bigger than the `end` index in such a case. * Tests for 'justify empty lines crash fix'
- Loading branch information
1 parent
c08b084
commit 1a9dd3e
Showing
3 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"positionedGlyphs": [ | ||
{ | ||
"codePoint": 97, | ||
"x": -32.5, | ||
"y": -41, | ||
"glyph": { | ||
"id": 97, | ||
"width": 11, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 13 | ||
} | ||
}, | ||
{ | ||
"codePoint": 98, | ||
"x": -19.5, | ||
"y": -41, | ||
"glyph": { | ||
"id": 98, | ||
"width": 12, | ||
"height": 20, | ||
"left": 2, | ||
"top": -7, | ||
"advance": 14 | ||
} | ||
}, | ||
{ | ||
"codePoint": 99, | ||
"x": -5.5, | ||
"y": -41, | ||
"glyph": { | ||
"id": 99, | ||
"width": 10, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 11 | ||
} | ||
}, | ||
{ | ||
"codePoint": 100, | ||
"x": 5.5, | ||
"y": -41, | ||
"glyph": { | ||
"id": 100, | ||
"width": 12, | ||
"height": 20, | ||
"left": 1, | ||
"top": -7, | ||
"advance": 14 | ||
} | ||
}, | ||
{ | ||
"codePoint": 101, | ||
"x": 19.5, | ||
"y": -41, | ||
"glyph": { | ||
"id": 101, | ||
"width": 12, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 13 | ||
} | ||
}, | ||
{ | ||
"codePoint": 10, | ||
"x": 65, | ||
"y": -41, | ||
"glyph": null | ||
}, | ||
{ | ||
"codePoint": 10, | ||
"x": 0, | ||
"y": -17, | ||
"glyph": null | ||
}, | ||
{ | ||
"codePoint": 97, | ||
"x": -32.5, | ||
"y": 7, | ||
"glyph": { | ||
"id": 97, | ||
"width": 11, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 13 | ||
} | ||
}, | ||
{ | ||
"codePoint": 98, | ||
"x": -19.5, | ||
"y": 7, | ||
"glyph": { | ||
"id": 98, | ||
"width": 12, | ||
"height": 20, | ||
"left": 2, | ||
"top": -7, | ||
"advance": 14 | ||
} | ||
}, | ||
{ | ||
"codePoint": 99, | ||
"x": -5.5, | ||
"y": 7, | ||
"glyph": { | ||
"id": 99, | ||
"width": 10, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 11 | ||
} | ||
}, | ||
{ | ||
"codePoint": 100, | ||
"x": 5.5, | ||
"y": 7, | ||
"glyph": { | ||
"id": 100, | ||
"width": 12, | ||
"height": 20, | ||
"left": 1, | ||
"top": -7, | ||
"advance": 14 | ||
} | ||
}, | ||
{ | ||
"codePoint": 101, | ||
"x": 19.5, | ||
"y": 7, | ||
"glyph": { | ||
"id": 101, | ||
"width": 12, | ||
"height": 15, | ||
"left": 1, | ||
"top": -12, | ||
"advance": 13 | ||
} | ||
} | ||
], | ||
"text": "abcde\n\nabcde", | ||
"top": -36, | ||
"bottom": 36, | ||
"left": -32.5, | ||
"right": 32.5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters