[Mono-bugs] [Bug 79254][Maj] New - Matrix.Scale() causes unwanted x, y Translation.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Sep 2 14:38:37 EDT 2006


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 wosscode at gmail.com.

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

--- shadow/79254	2006-09-02 14:38:37.000000000 -0400
+++ shadow/79254.tmp.31284	2006-09-02 14:38:37.000000000 -0400
@@ -0,0 +1,62 @@
+Bug#: 79254
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686 i386 GNU/Linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Drawing.
+AssignedTo: peter at novonyx.com                            
+ReportedBy: wosscode at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Matrix.Scale() causes unwanted x,y Translation.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+When using Matrix.Scale() it appears that an unwanted translation occurs as
+a result.  The amount of translation is apparently proportional to the
+scale factors used in Matrix.Scale(sf, sf).
+
+Actual Results:
+If Scale(100, 100) is used just before drawing a line with
+DrawLine(0,0...), then the actual visible results are drawn at (128, 64...).
+
+Expected Results:
+I would expect the start of the line (0,0) to be at (0,0) because scaline
+0,0 would have no effect.
+
+How often does this happen? 
+Every time without fail. (Many millions of attempts)
+
+Additional Information:
+
+A test app that I wrote on Windows to check this actually performed
+correctly on windows, but when that binary was run on my linux box with
+mono (Compiler: gmcs, versions 1.1.14 and 1.1.17) this strange phenomena
+was observed.
+
+I have managed to get around the problem by adding the following kludge-fix
+ in my own code...
+
+I insert this line BEFORE any of my program-specific scaling and
+translating code:
+
+MyMatrix.Translate( -scalefactor, -(scalefactor / 2));
+
+This seems to fix the problem.  To me it feels like there is a bug in the
+Matrix.Scale() implementation, just a hunch though.
+
+(I'm a seasoned graphics programmer so I know make sure I've reset all my
+transformations each time I render from scratch.)
+
+I only noticed this bug because I'm writing a CAD package for Windows/Linux
+and I need to make sure that everything is drawn as pixel perfect as possible.
+
+Hope this helps.


More information about the mono-bugs mailing list