Fix tests

This commit is contained in:
Jeremy Soller 2024-01-17 13:30:52 -07:00
parent a11f68f13d
commit 8457e68d98
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,8 @@ pub(crate) mod fallback;
use core::fmt;
use alloc::sync::Arc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use rustybuzz::Face as RustybuzzFace;
use self_cell::self_cell;

View file

@ -23,11 +23,11 @@ fn stable_wrap() {
let mut check_wrap = |text: &_, wrap, start_width| {
let line = ShapeLine::new(&mut font_system, text, &attrs, Shaping::Advanced);
let layout_unbounded = line.layout(font_size, start_width, wrap, Some(Align::Left));
let layout_unbounded = line.layout(font_size, start_width, wrap, Some(Align::Left), None);
let max_width = layout_unbounded.iter().map(|l| l.w).fold(0.0, f32::max);
let new_limit = f32::min(start_width, max_width);
let layout_bounded = line.layout(font_size, new_limit, wrap, Some(Align::Left));
let layout_bounded = line.layout(font_size, new_limit, wrap, Some(Align::Left), None);
let bounded_max_width = layout_bounded.iter().map(|l| l.w).fold(0.0, f32::max);
// For debugging: