[Mono-bugs] [Bug 81737][Nor] Changed - DrawRect not placed correctly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon May 28 15:21:17 EDT 2007


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 sebastien at ximian.com.

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

--- shadow/81737	2007-05-28 14:24:22.000000000 -0400
+++ shadow/81737.tmp.23948	2007-05-28 15:21:17.000000000 -0400
@@ -75,6 +75,31 @@
 don't see any easy way to totally remove it :(
 
 ------- Additional Comments From sebastien at ximian.com  2007-05-28 14:24 -------
 Good news, the AA is already disabled when scaling is detected (and
 this applies in your case). Another good news, applying AA to fills
 fix your test case. Bad news, this makes SWF regress :(
+
+------- Additional Comments From sebastien at ximian.com  2007-05-28 15:21 -------
+Your sample is *very* dependant on an exact match of libgdiplus/cairo
+and gdi+ because it does it's own calculations. E.g. The two calls:
+DrawFilledRect (e.Graphics, 50f, 50f, 100f, 50f, 1f);
+DrawFilledRect (e.Graphics, 50f, 150f, 100f, 50f, 2f);
+
+are transformed into:
+DrawRectangle 50.5,50.5,99,49
+FillRectangle 51,51,98,48
+DrawRectangle 51,151,98,48
+FillRectangle 52,152,96,46
+
+So you're drawing/filling side-by-side using float values. At some
+points things gets converted into pixels (integer) and it will (even
+when this issue is fixed) look bad. BTW that would explain why you
+have some failures, in certain cases, on MS GDI+ too.
+
+I'm not sure how much this samples looks like your application code
+but an easier way to do this (that won't depends on side-by-side and
+floats) would be to call Fill first then Draw using the same values
+(i.e. draw over the fill).
+
+This should work correctly on MS GDI+ and look better (than today) on
+Mono and eventually get identical to GDI+ output.


More information about the mono-bugs mailing list