summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 21:11:14 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 21:11:14 +0000
commit9d722ada61e1d80f0900a9ed7293b8da6e6153e8 (patch)
tree46dc0b90a43ce44f896bf4631f8f8c5e57afbe92 /app
parenta129a2bfb9ae935a8f1e56a5e3d4bd50a2168ef0 (diff)
downloadchromium_src-9d722ada61e1d80f0900a9ed7293b8da6e6153e8.zip
chromium_src-9d722ada61e1d80f0900a9ed7293b8da6e6153e8.tar.gz
chromium_src-9d722ada61e1d80f0900a9ed7293b8da6e6153e8.tar.bz2
Get the About panel to align its links correctly,
but undo a previous change to the way we measure strings in pango. Review URL: http://codereview.chromium.org/338001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rwxr-xr-x[-rw-r--r--]app/gfx/canvas_linux.cc10
-rwxr-xr-x[-rw-r--r--]app/gfx/font_skia.cc1
2 files changed, 2 insertions, 9 deletions
diff --git a/app/gfx/canvas_linux.cc b/app/gfx/canvas_linux.cc
index b08b4ce..e658c6a 100644..100755
--- 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.
diff --git a/app/gfx/font_skia.cc b/app/gfx/font_skia.cc
index 37cbe8d..8f6ccc1 100644..100755
--- a/app/gfx/font_skia.cc
+++ b/app/gfx/font_skia.cc
@@ -187,7 +187,6 @@ double Font::avg_width() {
int text_width = GetStringWidth(
L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
double dialog_units = (text_width / 26 + 1) / 2;
-
avg_width_ = std::min(pango_width, dialog_units);
pango_font_metrics_unref(pango_metrics);
pango_font_description_free(pango_desc);