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

Unified Diff: ui/gfx/render_text_linux.cc

Issue 18848002: Shows Japanese and English mixed queries correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disables the test on Android. Created 7 years, 5 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.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_linux.cc
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc
index e6a1ab725e4cda13a895e29a6fd1decb587d60aa..004064d247a9d24671e3edfc072835e3fd849f52 100644
--- a/ui/gfx/render_text_linux.cc
+++ b/ui/gfx/render_text_linux.cc
@@ -83,12 +83,17 @@ Size RenderTextLinux::GetStringSize() {
EnsureLayout();
int width = 0, height = 0;
pango_layout_get_pixel_size(layout_, &width, &height);
- return Size(width, height);
+ // Keep a consistent height between this particular string's PangoLayout and
+ // potentially larger text supported by the FontList.
+ return Size(width, std::max(height, font_list().GetHeight()));
}
int RenderTextLinux::GetBaseline() {
EnsureLayout();
- return PANGO_PIXELS(pango_layout_get_baseline(layout_));
+ // Keep a consistent baseline between this particular string's PangoLayout and
+ // potentially larger text supported by the FontList.
+ return std::max(PANGO_PIXELS(pango_layout_get_baseline(layout_)),
+ font_list().GetBaseline());
}
SelectionModel RenderTextLinux::FindCursorPosition(const Point& point) {
@@ -364,8 +369,7 @@ void RenderTextLinux::DrawVisualText(Canvas* canvas) {
DCHECK(layout_);
// Skia will draw glyphs with respect to the baseline.
- Vector2d offset(GetTextOffset() +
- Vector2d(0, PANGO_PIXELS(pango_layout_get_baseline(layout_))));
+ Vector2d offset(GetTextOffset() + Vector2d(0, GetBaseline()));
SkScalar x = SkIntToScalar(offset.x());
SkScalar y = SkIntToScalar(offset.y());
« no previous file with comments | « ui/gfx/render_text.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698