Use LayoutRects for bounds and overflow in display lists

Convert text runs to glyphs in display list builder.
Remove ComplexClippingRegion and use the WebRender type.
This commit is contained in:
Pyfisch 2018-02-01 22:44:52 +01:00
parent cf4f89c36e
commit 46ada747b0
6 changed files with 203 additions and 292 deletions

View file

@ -333,10 +333,10 @@ impl<'a> TextRun {
}
/// Returns the index in the range of the first glyph advancing over given advance
pub fn range_index_of_advance(&self, range: &Range<ByteIndex>, advance: Au) -> usize {
pub fn range_index_of_advance(&self, range: &Range<ByteIndex>, advance: f32) -> usize {
// TODO(Issue #199): alter advance direction for RTL
// TODO(Issue #98): using inter-char and inter-word spacing settings when measuring text
let mut remaining = advance;
let mut remaining = Au::from_f32_px(advance);
self.natural_word_slices_in_range(range)
.map(|slice| {
let (slice_index, slice_advance) =