diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2016-04-27 11:22:02 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2016-04-28 14:32:14 -0700 |
commit | 659305fe0a8f94e950ca64fab5ccef9949abd295 (patch) | |
tree | ac836803ac3fba799a4b4f73c24b4d0d2d208d6f /components/layout/display_list_builder.rs | |
parent | dba878dfb278619bf2d808c0c21758a937ec6bb7 (diff) | |
download | servo-659305fe0a8f94e950ca64fab5ccef9949abd295.tar.gz servo-659305fe0a8f94e950ca64fab5ccef9949abd295.zip |
Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking. This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
Diffstat (limited to 'components/layout/display_list_builder.rs')
-rw-r--r-- | components/layout/display_list_builder.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index fb2847e9d77..1d9d29b4cdd 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -31,7 +31,7 @@ use gfx::display_list::{LineDisplayItem, OpaqueNode, SolidColorDisplayItem}; use gfx::display_list::{StackingContext, StackingContextId, StackingContextType}; use gfx::display_list::{TextDisplayItem, TextOrientation, WebRenderImageInfo}; use gfx::paint_thread::THREAD_TINT_COLORS; -use gfx::text::glyph::CharIndex; +use gfx::text::glyph::ByteIndex; use gfx_traits::{color, ScrollPolicy}; use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT}; use ipc_channel::ipc::{self, IpcSharedMemory}; @@ -965,7 +965,7 @@ impl FragmentDisplayListBuilding for Fragment { Some(insertion_point_index) => insertion_point_index, None => return, }; - let range = Range::new(CharIndex(0), insertion_point_index); + let range = Range::new(ByteIndex(0), insertion_point_index); let advance = scanned_text_fragment_info.run.advance_for_range(&range); let insertion_point_bounds; |