aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/servo/layout/text.rs2
-rw-r--r--src/servo/text/text_run.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/servo/layout/text.rs b/src/servo/layout/text.rs
index 63ec074ade3..8f4a956a96a 100644
--- a/src/servo/layout/text.rs
+++ b/src/servo/layout/text.rs
@@ -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);
}
diff --git a/src/servo/text/text_run.rs b/src/servo/text/text_run.rs
index defff9233fb..5a16dc99927 100644
--- a/src/servo/text/text_run.rs
+++ b/src/servo/text/text_run.rs
@@ -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;
}