We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84af9a3 commit e29823dCopy full SHA for e29823d
1 file changed
litehtml/src/pixbuf.rs
@@ -445,11 +445,11 @@ impl DocumentContainer for PixbufContainer {
445
446
let mut fs = self.font_system.borrow_mut();
447
let mut buffer = cosmic_text::Buffer::new(&mut fs, ct_metrics);
448
- buffer.set_size(
449
- &mut fs,
450
- Some(pos.width.min(f32::MAX / 2.0)),
451
- Some(line_height),
452
- );
+ // Use unconstrained width so cosmic-text doesn't re-wrap. litehtml
+ // already sized and positioned each text run; rounding in pos.round()
+ // can shave fractional pixels off pos.width, causing the last glyph(s)
+ // to wrap onto an invisible second line.
+ buffer.set_size(&mut fs, Some(f32::MAX), Some(line_height));
453
buffer.set_text(&mut fs, text, &attrs, Shaping::Advanced);
454
buffer.shape_until_scroll(&mut fs, false);
455
0 commit comments