Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jan 17, 2024
1 parent 387e65a commit 004e77d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/font/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/wrap_stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 004e77d

Please sign in to comment.