pango r2584 - in trunk: . pango



Author: behdad
Date: Fri Mar 21 09:27:19 2008
New Revision: 2584
URL: http://svn.gnome.org/viewvc/pango?rev=2584&view=rev

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



Modified:
   trunk/ChangeLog
   trunk/pango/pango-layout.c

Modified: trunk/pango/pango-layout.c
==============================================================================
--- trunk/pango/pango-layout.c	(original)
+++ trunk/pango/pango-layout.c	Fri Mar 21 09:27:19 2008
@@ -2297,9 +2297,14 @@
     *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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]