[Mono-bugs] [Bug 59219][Wis] New - [NEEDINFO, PATCH] Fix Pen's transform handling

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 28 May 2004 00:27:05 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by duncan@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=59219

--- shadow/59219	2004-05-28 00:27:05.000000000 -0400
+++ shadow/59219.tmp.5822	2004-05-28 00:27:05.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 59219
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Drawing.
+AssignedTo: duncan@ximian.com                            
+ReportedBy: duncan@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [NEEDINFO, PATCH] Fix Pen's transform handling
+
+The pen setup process was setting up the matrix for the whole context
+to its own pen transformation, which means that all the other
+transformations were basically being ignored.
+
+The code in gdip_pen_setup says
+
+        if (pen->matrix != NULL)
+                cairo_set_matrix (graphics->ct, pen->matrix);
+
+Which means every time we call a drawing operation, we call
+gdip_pen_setup, the pen should inherit the matrix from the graphics->ct
+that at moment, but it never happens, because gdip_pen_init () always
+set matrix to cairo_matrix_create ();
+
+Given:
+
+1        Graphics g = ....;
+2        Pen p = new Pen (...);
+3        g.DrawLine (p, 0, 0, 10, 10);
+4        g.RotateMatrix (90);
+5        g.DrawLine (p, 0, 0, 10, 10);
+
+The Pen's matrix gets set in line 2. graphics's matrix gets updated in line
+3. Line 4 calls gdip_pen_setup, but pen->matrix is set already (from line
+2), so pen->matrix does not get updated to the newly transformed matrix in
+graphics->ct.
+
+We need to see what happens when we change the pen's Matrix (i.e. between
+line 3, 4, or 4, 5)