mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Remove mode from TextRun ctor
This commit is contained in:
parent
6859730f7a
commit
6a5a579b98
2 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue