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. |