Remove mode from TextRun ctor

This commit is contained in:
Brian Anderson 2012-09-14 16:30:04 -07:00
parent 6859730f7a
commit 6a5a579b98
2 changed files with 6 additions and 6 deletions

View file

@ -33,7 +33,7 @@ impl @Box : TextLayout {
// FIXME: The font library should not be initialized here
let flib = FontLibrary();
let font = flib.get_test_font();
let run = TextRun(*font, subbox.text);
let run = TextRun(font, subbox.text);
self.bounds.size = run.size();
subbox.run = Some(run);
}

View file

@ -20,13 +20,13 @@ impl TextRun {
fn min_break_width() -> au { self.min_break_width_ }
}
fn TextRun(font: Font, text: ~str) -> TextRun {
let glyphs = shape_text(&font, text);
fn TextRun(font: &Font, text: ~str) -> TextRun {
let glyphs = shape_text(font, text);
let size = glyph_run_size(glyphs);
let min_break_width = calc_min_break_width(&font, text);
let min_break_width = calc_min_break_width(font, text);
TextRun {
glyphs: shape_text(&font, text),
glyphs: shape_text(font, text),
size_: size,
min_break_width_: min_break_width
}
@ -175,7 +175,7 @@ fn should_calculate_the_total_size() {
let flib = FontLibrary();
let font = flib.get_test_font();
let run = TextRun(*font, ~"firecracker");
let run = TextRun(font, ~"firecracker");
let expected = Size2D(px_to_au(84), px_to_au(20));
assert run.size() == expected;
}