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

Unified Diff: ui/gfx/render_text_win.cc

Issue 440213004: Support float widths in RenderTextHarfBuzz. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update RenderTextWin minimally. Created 6 years, 4 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
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_win.cc
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index c7cb9340461b28e72d82ec9062330138c5c6f105..e76e6db39e8a55af31a8b1a0a1e0ad349bd86953 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -17,6 +17,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/font_fallback_win.h"
#include "ui/gfx/font_render_params.h"
+#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/platform_font_win.h"
#include "ui/gfx/utf16_indexing.h"
@@ -389,8 +390,9 @@ class LineBreaker {
line->baseline = line_ascent_;
line->size.set_height(line_ascent_ + line_descent_);
line->preceding_heights = total_size_.height();
- total_size_.set_height(total_size_.height() + line->size.height());
- total_size_.set_width(std::max(total_size_.width(), line->size.width()));
+ const Size line_size(ToCeiledSize(line->size));
+ total_size_.set_height(total_size_.height() + line_size.height());
+ total_size_.set_width(std::max(total_size_.width(), line_size.width()));
}
line_x_ = 0;
line_ascent_ = 0;
@@ -762,7 +764,7 @@ void RenderTextWin::DrawVisualText(Canvas* canvas) {
// Skip painting empty lines or lines outside the display rect area.
if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset),
- line.size)))
+ ToCeiledSize(line.size))))
continue;
const Vector2d text_offset = line_offset + Vector2d(0, line.baseline);
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698