diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-01-24 14:02:13 -0800 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-01-24 14:02:13 -0800 |
commit | 2ee9d2be83e124514214ffa1f21d37156961c56c (patch) | |
tree | a785ad186965e47e079744a12daf80df26baa74f /src/components | |
parent | 6e4d96a7f65b33baac8d4a0848e65b3e2e9f0e37 (diff) | |
download | servo-2ee9d2be83e124514214ffa1f21d37156961c56c.tar.gz servo-2ee9d2be83e124514214ffa1f21d37156961c56c.zip |
Use logical clump offset into newline position list. Fixes wikipedia vector index failures.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/main/layout/text.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/main/layout/text.rs b/src/components/main/layout/text.rs index a43a0077e03..e4ad1f8bc57 100644 --- a/src/components/main/layout/text.rs +++ b/src/components/main/layout/text.rs @@ -220,7 +220,8 @@ impl TextRunScanner { // Make new boxes with the run and adjusted text indices. debug!("TextRunScanner: pushing box(es) in range: {}", self.clump); for i in clump.eachi() { - let range = new_ranges[i - self.clump.begin()]; + let logical_offset = i - self.clump.begin(); + let range = new_ranges[logical_offset]; if range.length() == 0 { debug!("Elided an `UnscannedTextbox` because it was zero-length after \ compression; {:s}", @@ -232,7 +233,7 @@ impl TextRunScanner { let new_metrics = new_text_box_info.run.get().metrics_for_range(&range); let mut new_box = in_boxes[i].transform(new_metrics.bounding_box.size, ScannedTextBox(new_text_box_info)); - new_box.new_line_pos = new_line_positions[i].new_line_pos.clone(); + new_box.new_line_pos = new_line_positions[logical_offset].new_line_pos.clone(); out_boxes.push(new_box) } } |