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

Unified Diff: app/gfx/canvas_linux.cc

Issue 338001: Get the About panel to align its links correctly, (Closed)
Patch Set: Found some leftover cruft in files. Created 11 years, 2 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 | « no previous file | app/gfx/font_skia.cc » ('j') | chrome/browser/chromeos/status_area_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/canvas_linux.cc
diff --git a/app/gfx/canvas_linux.cc b/app/gfx/canvas_linux.cc
old mode 100644
new mode 100755
index b08b4ce92c0e9726c323b697c0d5eee4bfcc31ee..e658c6ac184878f5deffe17d4d06ced77851788d
--- a/app/gfx/canvas_linux.cc
+++ b/app/gfx/canvas_linux.cc
@@ -154,11 +154,7 @@ void Canvas::SizeStringInt(const std::wstring& text,
std::string utf8 = WideToUTF8(text);
pango_layout_set_text(layout, utf8.data(), utf8.size());
- int chars_height;
- pango_layout_get_size(layout, width, &chars_height);
- *width /= PANGO_SCALE;
- // Pango returns the height of the characters, not the height of the font.
- *height = font.height();
+ pango_layout_get_pixel_size(layout, width, height);
g_object_unref(layout);
cairo_destroy(cr);
@@ -187,9 +183,7 @@ void Canvas::DrawStringInt(const std::wstring& text,
pango_layout_set_text(layout, utf8.data(), utf8.size());
int width, height;
- pango_layout_get_size(layout, &width, &height);
- width /= PANGO_SCALE;
- height /= PANGO_SCALE;
+ pango_layout_get_pixel_size(layout, &width, &height);
if (flags & Canvas::TEXT_VALIGN_TOP) {
// Cairo should draw from the top left corner already.
« no previous file with comments | « no previous file | app/gfx/font_skia.cc » ('j') | chrome/browser/chromeos/status_area_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698