dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[Dotgnu-pnet-commits] pnetlib/System.Windows.Forms Label.cs, 1.8, 1.9


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/System.Windows.Forms Label.cs, 1.8, 1.9
Date: Fri, 14 Nov 2003 21:02:13 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv24214/System.Windows.Forms

Modified Files:
        Label.cs 
Log Message:


Account for a small discrepancy between the defined behaviour of
MeasureString and DrawString by adding 1 to the preferred label width.


Index: Label.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Label.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Label.cs    2 Nov 2003 22:14:38 -0000       1.8
--- Label.cs    14 Nov 2003 21:01:48 -0000      1.9
***************
*** 204,209 ****
                                        if(text == null || text == String.Empty)
                                        {
!                                               preferredWidth = 0;
!                                               return 0;
                                        }
  
--- 204,213 ----
                                        if(text == null || text == String.Empty)
                                        {
!                                               preferredWidth = 1;
!                                               if(BorderStyle != 
BorderStyle.None)
!                                               {
!                                                       preferredWidth += 4;
!                                               }
!                                               return preferredWidth;
                                        }
  
***************
*** 214,218 ****
                                                        (text, Font, new 
SizeF(0.0f, 0.0f), GetStringFormat());
  
!                                       // Return the ceiling of the width.
                                #if CONFIG_EXTENDED_NUMERICS
                                        preferredWidth = 
(int)(Math.Ceiling(size.Width));
--- 218,224 ----
                                                        (text, Font, new 
SizeF(0.0f, 0.0f), GetStringFormat());
  
!                                       // Return the ceiling of the width.  We 
add one to
!                                       // account for a small discrepancy 
between the behaviour
!                                       // of MeasureString and DrawString.
                                #if CONFIG_EXTENDED_NUMERICS
                                        preferredWidth = 
(int)(Math.Ceiling(size.Width));
***************
*** 220,223 ****
--- 226,230 ----
                                        preferredWidth = (int)(size.Width + 
0.99f);
                                #endif
+                                       ++preferredWidth;
                                        if(BorderStyle != BorderStyle.None)
                                        {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]