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

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

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing/Drawing2D Matrix.cs,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing/Drawing2D Matrix.cs,1.1,1.2
Date: Mon, 09 Jun 2003 17:25:39 -0400

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

Modified Files:
        Matrix.cs 
Log Message:


Font management; texture brushes; some type converters;
system brushes and pens.


Index: Matrix.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Drawing2D/Matrix.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Matrix.cs   7 Jun 2003 22:40:58 -0000       1.1
--- Matrix.cs   9 Jun 2003 21:25:37 -0000       1.2
***************
*** 57,60 ****
--- 57,69 ----
                                this.dy  = dy;
                        }
+       internal Matrix(Matrix matrix)
+                       {
+                               this.m11 = matrix.m11;
+                               this.m12 = matrix.m12;
+                               this.m21 = matrix.m21;
+                               this.m22 = matrix.m22;
+                               this.dx  = matrix.dx;
+                               this.dy  = matrix.dy;
+                       }
  
        // Destructor.
***************
*** 502,505 ****
--- 511,543 ----
                                ox = x * m11 + y * m21 + dx;
                                oy = x * m12 + y * m22 + dy;
+                       }
+ 
+       // Transform a size value according to the inverse transformation.
+       internal void TransformSizeBack(float width, float height,
+                                                                       out 
float owidth, out float oheight)
+                       {
+                               float m11, m12, m21, m22;
+                               float determinant;
+ 
+                               // Compute the determinant and check it.
+                               determinant = this.m11 * this.m22 - this.m21 * 
this.m11;
+                               if(determinant != 0.0f)
+                               {
+                                       // Get the answer into temporary 
variables.
+                                       // We ignore dx and dy because we don't 
need them.
+                                       m11 = this.m22 / determinant;
+                                       m12 = -(this.m12 / determinant);
+                                       m21 = -(this.m21 / determinant);
+                                       m22 = this.m11 / determinant;
+ 
+                                       // Compute the final values.
+                                       owidth  = width * m11 + height * m21;
+                                       oheight = width * m12 + height * m22;
+                               }
+                               else
+                               {
+                                       owidth = width;
+                                       oheight = height;
+                               }
                        }
  





reply via email to

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