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

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

[Dotgnu-pnet-commits] pnetlib/System.Drawing Bitmap.cs, 1.6, 1.7 Color.c


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/System.Drawing Bitmap.cs, 1.6, 1.7 Color.cs, 1.2, 1.3 ContentAlignment.cs, 1.1, 1.2 Font.cs, 1.6, 1.7 Graphics.cs, 1.16, 1.17 ImageFormatConverter.cs, 1.2, 1.3 Region.cs, 1.6, 1.7
Date: Mon, 29 Sep 2003 03:56:40 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing
In directory subversions:/tmp/cvs-serv28227/System.Drawing

Modified Files:
        Bitmap.cs Color.cs ContentAlignment.cs Font.cs Graphics.cs 
        ImageFormatConverter.cs Region.cs 
Log Message:


More fixes for build profiles, particularly those lacking floating point.


Index: Bitmap.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Bitmap.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Bitmap.cs   4 Sep 2003 22:24:20 -0000       1.6
--- Bitmap.cs   29 Sep 2003 03:56:38 -0000      1.7
***************
*** 35,39 ****
  [ComVisible(true)]
  #endif
! #if CONFIG_COMPONENT_MODEL
  [Editor("System.Drawing.Design.BitmapEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
--- 35,39 ----
  [ComVisible(true)]
  #endif
! #if CONFIG_COMPONENT_MODEL_DESIGN
  [Editor("System.Drawing.Design.BitmapEditor, System.Drawing.Design",
                typeof(UITypeEditor))]

Index: Region.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Region.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Region.cs   11 Sep 2003 14:59:18 -0000      1.6
--- Region.cs   29 Sep 2003 03:56:38 -0000      1.7
***************
*** 158,161 ****
--- 158,207 ----
        }
  
+       // Helpers, to replace missing "Math" class in some profiles.
+       private static int Math_Min(int a, int b)
+       {
+               if(a < b)
+               {
+                       return a;
+               }
+               else
+               {
+                       return b;
+               }
+       }
+       private static float Math_Min(float a, float b)
+       {
+               if(a < b)
+               {
+                       return a;
+               }
+               else
+               {
+                       return b;
+               }
+       }
+       private static int Math_Max(int a, int b)
+       {
+               if(a > b)
+               {
+                       return a;
+               }
+               else
+               {
+                       return b;
+               }
+       }
+       private static float Math_Max(float a, float b)
+       {
+               if(a > b)
+               {
+                       return a;
+               }
+               else
+               {
+                       return b;
+               }
+       }
+ 
        // Make an exact copy of this region.
        public Region Clone()
***************
*** 784,789 ****
                        RectangleF rect1 = reg1.rects[r1];
                        RectangleF rect2 = reg2.rects[r2];
!                       left = Math.Max(rect1.Left, rect2.Left);
!                       right = Math.Min(rect1.Right, rect2.Right);
  
                        /*
--- 830,835 ----
                        RectangleF rect1 = reg1.rects[r1];
                        RectangleF rect2 = reg2.rects[r2];
!                       left = Math_Max(rect1.Left, rect2.Left);
!                       right = Math_Min(rect1.Right, rect2.Right);
  
                        /*
***************
*** 989,993 ****
                 * want to use too much memory.
                 */
!               Region newReg = new Region(Math.Max(reg1.rects.Length, 
reg2.rects.Length) * 2);
                // The total number of rectangles we have written to the array
                int nextRectangle = 0;
--- 1035,1039 ----
                 * want to use too much memory.
                 */
!               Region newReg = new Region(Math_Max(reg1.rects.Length, 
reg2.rects.Length) * 2);
                // The total number of rectangles we have written to the array
                int nextRectangle = 0;
***************
*** 1054,1059 ****
                        if (rect1.Top < rect2.Top)
                        {
!                               top = Math.Max(rect1.Top, ybot);
!                               bot = Math.Min(rect1.Bottom, rect2.Top);
  
                                if ((top != bot))
--- 1100,1105 ----
                        if (rect1.Top < rect2.Top)
                        {
!                               top = Math_Max(rect1.Top, ybot);
!                               bot = Math_Min(rect1.Bottom, rect2.Top);
  
                                if ((top != bot))
***************
*** 1069,1074 ****
                        else if (rect2.Top < rect1.Top)
                        {
!                               top = Math.Max(rect2.Top, ybot);
!                               bot = Math.Min(rect2.Bottom, rect1.Top);
  
                                if (top != bot)
--- 1115,1120 ----
                        else if (rect2.Top < rect1.Top)
                        {
!                               top = Math_Max(rect2.Top, ybot);
!                               bot = Math_Min(rect2.Bottom, rect1.Top);
  
                                if (top != bot)
***************
*** 1098,1102 ****
                         * intersect if ybot > ytop
                         */
!                       ybot = Math.Min(rect1.Bottom, rect2.Bottom);
                        curBand = nextRectangle;
                        if (ybot > ytop)
--- 1144,1148 ----
                         * intersect if ybot > ytop
                         */
!                       ybot = Math_Min(rect1.Bottom, rect2.Bottom);
                        curBand = nextRectangle;
                        if (ybot > ytop)
***************
*** 1139,1145 ****
                                                r1BandEnd++;
                                        if (regionOperationType == 
RegionOperationType.Subtract)
!                                               SubtractNonOverlapBands(newReg, 
ref nextRectangle, reg1, r1, r1BandEnd, Math.Max(rect1.Top, ybot), 
rect1.Bottom);
                                        else if (regionOperationType == 
RegionOperationType.Union)
!                                               UnionNonOverlapBands(newReg, 
ref nextRectangle, reg1, r1, r1BandEnd, Math.Max(rect1.Top, ybot), 
rect1.Bottom);
                                        r1 = r1BandEnd;
                                }
--- 1185,1191 ----
                                                r1BandEnd++;
                                        if (regionOperationType == 
RegionOperationType.Subtract)
!                                               SubtractNonOverlapBands(newReg, 
ref nextRectangle, reg1, r1, r1BandEnd, Math_Max(rect1.Top, ybot), 
rect1.Bottom);
                                        else if (regionOperationType == 
RegionOperationType.Union)
!                                               UnionNonOverlapBands(newReg, 
ref nextRectangle, reg1, r1, r1BandEnd, Math_Max(rect1.Top, ybot), 
rect1.Bottom);
                                        r1 = r1BandEnd;
                                }
***************
*** 1155,1159 ****
                                while (r2BandEnd < r2End && 
reg2.rects[r2BandEnd].Top == rect2.Top)
                                        r2BandEnd++;
!                               UnionNonOverlapBands(newReg, ref nextRectangle, 
reg2, r2, r2BandEnd, Math.Max(rect2.Top, ybot), rect2.Bottom);
                                r2 = r2BandEnd;
                        } while (r2 != r2End);
--- 1201,1205 ----
                                while (r2BandEnd < r2End && 
reg2.rects[r2BandEnd].Top == rect2.Top)
                                        r2BandEnd++;
!                               UnionNonOverlapBands(newReg, ref nextRectangle, 
reg2, r2, r2BandEnd, Math_Max(rect2.Top, ybot), rect2.Bottom);
                                r2 = r2BandEnd;
                        } while (r2 != r2End);

Index: Font.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Font.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Font.cs     25 Aug 2003 16:13:30 -0000      1.6
--- Font.cs     29 Sep 2003 03:56:38 -0000      1.7
***************
*** 29,33 ****
  using System.Drawing.Design;
  
! #if CONFIG_COMPONENT_MODEL
  [Editor("System.Drawing.Design.FontEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
--- 29,33 ----
  using System.Drawing.Design;
  
! #if CONFIG_COMPONENT_MODEL_DESIGN
  [Editor("System.Drawing.Design.FontEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
***************
*** 206,212 ****
  #if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [Editor("System.Drawing.Design.FontNameEditor, System.Drawing.Design",
                        typeof(UITypeEditor))]
-       [TypeConverter(typeof(FontConverter.FontNameConverter))]
  #endif
        public String Name
--- 206,214 ----
  #if CONFIG_COMPONENT_MODEL
        
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+       [TypeConverter(typeof(FontConverter.FontNameConverter))]
+ #endif
+ #if CONFIG_COMPONENT_MODEL_DESIGN
        [Editor("System.Drawing.Design.FontNameEditor, System.Drawing.Design",
                        typeof(UITypeEditor))]
  #endif
        public String Name

Index: ContentAlignment.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/ContentAlignment.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ContentAlignment.cs 7 Jun 2003 22:40:57 -0000       1.1
--- ContentAlignment.cs 29 Sep 2003 03:56:38 -0000      1.2
***************
*** 26,30 ****
  using System.Drawing.Design;
  
! #if CONFIG_COMPONENT_MODEL
  [Editor("System.Drawing.Design.ContentAlignmentEditor, System.Drawing.Design",
                typeof(UITypeEditor))]
--- 26,30 ----
  using System.Drawing.Design;
  
! #if CONFIG_COMPONENT_MODEL_DESIGN
  [Editor("System.Drawing.Design.ContentAlignmentEditor, System.Drawing.Design",
                typeof(UITypeEditor))]

Index: Graphics.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Graphics.cs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Graphics.cs 4 Sep 2003 22:22:01 -0000       1.16
--- Graphics.cs 29 Sep 2003 03:56:38 -0000      1.17
***************
*** 834,838 ****
        public void DrawImage(Image image, float x, float y)
                        {
!                               ToolkitGraphics.DrawImage(image.toolkitImage, 
(int)Math.Ceiling(x), (int)Math.Ceiling(y));
                        }
        [TODO]
--- 834,840 ----
        public void DrawImage(Image image, float x, float y)
                        {
!                               int dx, dy;
!                               ConvertPoint(x, y, out dx, out dy);
!                               ToolkitGraphics.DrawImage(image.toolkitImage, 
dx, dy);
                        }
        [TODO]

Index: Color.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Color.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Color.cs    14 Jun 2003 02:20:58 -0000      1.2
--- Color.cs    29 Sep 2003 03:56:38 -0000      1.3
***************
*** 32,36 ****
  [ComVisible(true)]
  #endif
! #if CONFIG_COMPONENT_MODEL
  [TypeConverter(typeof(ColorConverter))]
  [Editor("System.Drawing.Design.ColorEditor, System.Drawing.Design",
--- 32,36 ----
  [ComVisible(true)]
  #endif
! #if CONFIG_COMPONENT_MODEL_DESIGN
  [TypeConverter(typeof(ColorConverter))]
  [Editor("System.Drawing.Design.ColorEditor, System.Drawing.Design",

Index: ImageFormatConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/ImageFormatConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ImageFormatConverter.cs     28 Sep 2003 22:06:39 -0000      1.2
--- ImageFormatConverter.cs     29 Sep 2003 03:56:38 -0000      1.3
***************
*** 37,43 ****
--- 37,45 ----
                public override bool CanConvertTo(ITypeDescriptorContext 
context, Type destinationType)
                {
+               #if CONFIG_COMPONENT_MODEL_DESIGN
                        if (destinationType == typeof(InstanceDescriptor))
                                return true;
                        else
+               #endif
                                return base.CanConvertTo(context, 
destinationType);
                }
***************
*** 83,88 ****
--- 85,92 ----
                                        if (destinationType == typeof(string))
                                                return property.Name;
+                               #if CONFIG_COMPONENT_MODEL_DESIGN
                                        else if (destinationType == 
typeof(InstanceDescriptor))
                                                return new 
InstanceDescriptor(property, null);
+                               #endif
                                }
                        }





reply via email to

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