Author: spouliot
Date: 2006-10-17 16:22:11 -0400 (Tue, 17 Oct 2006)
New Revision: 66760

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/graphics.c
Log:
2006-10-17  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * graphics.c: Another fix to StringAlignmentCenter when a single
        character is drawn (#79685). This adjust the band-aid done for #79573
        awaiting a bigger rewrite (to move alignement from drawing to measure)



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-10-17 19:14:21 UTC (rev 66759)
+++ trunk/libgdiplus/src/ChangeLog      2006-10-17 20:22:11 UTC (rev 66760)
@@ -1,3 +1,9 @@
+2006-10-17  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * graphics.c: Another fix to StringAlignmentCenter when a single
+       character is drawn (#79685). This adjust the band-aid done for #79573
+       awaiting a bigger rewrite (to move alignement from drawing to measure)
+
 2006-10-16  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * graphics.h: Define G_MAXINT32 ourselves (if undefined).

Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c     2006-10-17 19:14:21 UTC (rev 66759)
+++ trunk/libgdiplus/src/graphics.c     2006-10-17 20:22:11 UTC (rev 66760)
@@ -2796,8 +2796,8 @@
                                case StringAlignmentNear:
                                        break;
                                case StringAlignmentCenter:
-                                       /* PosX isn't calculated if the char is 
out of the bounding box (#79573) */
-                                       if (StringDetails 
[current_line_length-1].PosX > 0) {
+                                       /* PosX isn't calculated if the char is 
out of the bounding box (#79573/#79685) */
+                                       if ((current_line_length == 1) || 
(StringDetails [current_line_length-1].PosX > 0)) {
                                                CursorX += (rc->Width - 
StringDetails [current_line_length-1].PosX - 
                                                        StringDetails 
[current_line_length-1].Width) / 2;
                                        }
@@ -2823,8 +2823,8 @@
                                case StringAlignmentNear:
                                        break;
                                case StringAlignmentCenter:
-                                       /* PosX isn't calculated if the char is 
out of the bounding box (#79573) */
-                                       if (StringDetails 
[current_line_length-1].PosX > 0) {
+                                       /* PosX isn't calculated if the char is 
out of the bounding box (#79573/#79685) */
+                                       if ((current_line_length == 1) || 
(StringDetails [current_line_length-1].PosX > 0)) {
                                                CursorY += (rc->Height - 
StringDetails[current_line_length-1].PosX - 
                                                        StringDetails 
[current_line_length-1].Width) / 2;
                                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to