Do not wrap empty lines
This commit is contained in:
parent
3d60d55309
commit
dd94bc634b
1 changed files with 2 additions and 4 deletions
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
use unicode_bidi::Level;
|
||||
use core::mem;
|
||||
use core::ops::Range;
|
||||
use unicode_script::{Script, UnicodeScript};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
|
|
@ -622,7 +620,7 @@ impl ShapeLine {
|
|||
x + x_advance > end_x
|
||||
};
|
||||
|
||||
if glyph_wrap {
|
||||
if glyph_wrap && ! glyphs.is_empty() {
|
||||
let mut glyphs_swap = Vec::new();
|
||||
mem::swap(&mut glyphs, &mut glyphs_swap);
|
||||
layout_lines.push(
|
||||
|
|
@ -649,7 +647,7 @@ impl ShapeLine {
|
|||
}
|
||||
}
|
||||
|
||||
if wrap {
|
||||
if wrap && ! glyphs.is_empty() {
|
||||
let mut glyphs_swap = Vec::new();
|
||||
mem::swap(&mut glyphs, &mut glyphs_swap);
|
||||
layout_lines.push(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue