diff options
author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-05-08 10:52:54 -0700 |
---|---|---|
committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-05-12 11:57:29 -0700 |
commit | 49df943649fec64a80b56bd26f0fb6454dc281bd (patch) | |
tree | a2246be072540a2bda307fecc3a9a8fccc7478af /src/components/main/layout/inline.rs | |
parent | 68f9aad883fb7335b9e2dddb24e96fb61c5653bc (diff) | |
download | servo-49df943649fec64a80b56bd26f0fb6454dc281bd.tar.gz servo-49df943649fec64a80b56bd26f0fb6454dc281bd.zip |
Add RangeIndex trait and iterator
This will allow for the definition of typesafe range units in the future, for example for glyph indices. This also adds a macro that allows for the easy implementation of new range index types.
Diffstat (limited to 'src/components/main/layout/inline.rs')
-rw-r--r-- | src/components/main/layout/inline.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/main/layout/inline.rs b/src/components/main/layout/inline.rs index 060fd7f6344..e797120cb02 100644 --- a/src/components/main/layout/inline.rs +++ b/src/components/main/layout/inline.rs @@ -713,7 +713,7 @@ impl InlineFlow { text_align::right => slack_width, }; - for i in line.range.eachi() { + for i in line.range.each_index() { let box_ = boxes.get_mut(i as uint); let size = box_.border_box.size; box_.border_box = Rect(Point2D(offset_x, box_.border_box.origin.y), size); @@ -844,7 +844,7 @@ impl Flow for InlineFlow { let (mut largest_height_for_top_fragments, mut largest_height_for_bottom_fragments) = (Au(0), Au(0)); - for box_i in line.range.eachi() { + for box_i in line.range.each_index() { let fragment = self.boxes.boxes.get_mut(box_i as uint); let InlineMetrics { @@ -920,7 +920,7 @@ impl Flow for InlineFlow { // Compute the final positions in the block direction of each fragment. Recall that // `fragment.border_box.origin.y` was set to the distance from the baseline above. - for box_i in line.range.eachi() { + for box_i in line.range.each_index() { let fragment = self.boxes.get_mut(box_i as uint); match fragment.vertical_align() { vertical_align::top => { |