Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp

Issue 2875933006: [LayoutNG] Misc fixes in ShapingLineBreaker (Closed)
Patch Set: clang build fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
index bd1254aea0376522dce5fbd9ccdcf9b8c047e93c..963a6c85b7c5e2a1bf99f8b344144628580ce295 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -183,6 +183,17 @@ size_t ShapeResult::ByteSize() const {
return self_byte_size;
}
+unsigned ShapeResult::CharacterStartIndex() const {
+ return !Rtl() ? runs_.front()->start_index_ : runs_.back()->start_index_;
+}
+
+unsigned ShapeResult::OffsetForPosition(float target_x,
+ OffsetOptions options) const {
+ if (options == kOutsideAsStartOrEnd && target_x <= 0)
+ return Rtl() ? num_characters_ : 0;
+ return OffsetForPosition(target_x, false);
+}
+
unsigned ShapeResult::OffsetForPosition(float target_x,
bool include_partial_glyphs) const {
unsigned characters_so_far = 0;

Powered by Google App Engine
This is Rietveld 408576698