mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
~[] to Vec in gfx/text/text_run.rs
This commit is contained in:
parent
2903e55de0
commit
b88c84dde8
1 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ pub struct TextRun {
|
||||||
pub font_metrics: FontMetrics,
|
pub font_metrics: FontMetrics,
|
||||||
pub font_style: FontStyle,
|
pub font_style: FontStyle,
|
||||||
pub decoration: text_decoration::T,
|
pub decoration: text_decoration::T,
|
||||||
pub glyphs: Arc<~[Arc<GlyphStore>]>,
|
pub glyphs: Arc<Vec<Arc<GlyphStore>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SliceIterator<'a> {
|
pub struct SliceIterator<'a> {
|
||||||
|
@ -113,10 +113,10 @@ impl<'a> TextRun {
|
||||||
pub fn teardown(&self) {
|
pub fn teardown(&self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn break_and_shape(font: &mut Font, text: &str) -> ~[Arc<GlyphStore>] {
|
pub fn break_and_shape(font: &mut Font, text: &str) -> Vec<Arc<GlyphStore>> {
|
||||||
// TODO(Issue #230): do a better job. See Gecko's LineBreaker.
|
// TODO(Issue #230): do a better job. See Gecko's LineBreaker.
|
||||||
|
|
||||||
let mut glyphs = ~[];
|
let mut glyphs = Vec::new();
|
||||||
let mut byte_i = 0u;
|
let mut byte_i = 0u;
|
||||||
let mut cur_slice_is_whitespace = false;
|
let mut cur_slice_is_whitespace = false;
|
||||||
let mut byte_last_boundary = 0;
|
let mut byte_last_boundary = 0;
|
||||||
|
@ -174,7 +174,7 @@ impl<'a> TextRun {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn glyphs(&'a self) -> &'a ~[Arc<GlyphStore>] {
|
pub fn glyphs(&'a self) -> &'a Vec<Arc<GlyphStore>> {
|
||||||
&*self.glyphs
|
&*self.glyphs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue