summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-03-21 09:27:19 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-03-21 09:27:19 +0000
commit6758d48c8283896856f3af3d545b6b836078078b (patch)
tree24ac7df5387d9ae77464a5be8c47c051bb6edf84 /pango/pango-layout.c
parent15af7e09d1a72384b309ffef0da1fc08383e702f (diff)
downloadpango-6758d48c8283896856f3af3d545b6b836078078b.tar.gz
When doing ALIGN_CENTER, round line offset to whole pixel if hinting.
2008-03-21 Behdad Esfahbod <behdad@gnome.org> * pango/pango-layout.c (get_x_offset): When doing ALIGN_CENTER, round line offset to whole pixel if hinting. svn path=/trunk/; revision=2584
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 137ebabd..af816689 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2297,9 +2297,14 @@ get_x_offset (PangoLayout *layout,
*x_offset = 0;
else if (alignment == PANGO_ALIGN_RIGHT)
*x_offset = layout_width - line_width;
- else if (alignment == PANGO_ALIGN_CENTER)
+ else if (alignment == PANGO_ALIGN_CENTER) {
*x_offset = (layout_width - line_width) / 2;
- else
+ /* hinting */
+ if (((layout_width | line_width) & (PANGO_SCALE - 1)) == 0)
+ {
+ *x_offset = PANGO_UNITS_ROUND (*x_offset);
+ }
+ } else
*x_offset = 0;
/* Indentation */