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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 876873003: Add float version of gfx::Range (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RangeF unit tests Created 5 years, 11 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: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 82580b3961f5d475e71b407b70839cc35b8cc6be..e4a0dd6b9a66d366e070446b0bc4d236252fdb94 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -25,7 +25,6 @@
#include "ui/gfx/font_fallback_win.h"
#endif
-using gfx::internal::RangeF;
using gfx::internal::RoundRangeF;
namespace gfx {
@@ -469,8 +468,8 @@ void GetClusterAtImpl(size_t pos,
namespace internal {
Range RoundRangeF(const RangeF& range_f) {
- return Range(std::floor(range_f.first + 0.5f),
- std::floor(range_f.second + 0.5f));
+ return Range(std::floor(range_f.start() + 0.5f),
+ std::floor(range_f.end() + 0.5f));
}
TextRunHarfBuzz::TextRunHarfBuzz()
@@ -666,9 +665,9 @@ Range RenderTextHarfBuzz::GetGlyphBounds(size_t index) {
// position since clients expect them to be contiguous.
if (cursor_enabled() && run_index == runs_.size() - 1 &&
index == (run->is_rtl ? run->range.start() : run->range.end() - 1))
- bounds.second = std::ceil(bounds.second);
+ bounds.set_end(std::ceil(bounds.end()));
return RoundRangeF(run->is_rtl ?
- RangeF(bounds.second, bounds.first) : bounds);
+ RangeF(bounds.end(), bounds.start()) : bounds);
}
int RenderTextHarfBuzz::GetLayoutTextBaseline() {

Powered by Google App Engine
This is Rietveld 408576698