Author: duncan
Date: 2005-05-09 12:16:49 -0400 (Mon, 09 May 2005)
New Revision: 44289
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/graphics.c
Log:
2005-05-09 Duncan Mak <[EMAIL PROTECTED]>
* graphics.c (make_pie, GdipDrawArc): when evaluating angles,
always use abs(). This fixes the drawing of arcs and pies when the
sweep angle is negative.
Bug #63360 has also been fixed. This was a bug reported by
Ravindra in August '04 about a hang when "the difference between
width and height of rectangle is 1 and angles sum is close to
360". My change doesn't affect this bug. #63360 didn't hang in
libgdiplus 1.1.7 as is, so it was actually fixed by the Cairo
guys.
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2005-05-09 16:04:01 UTC (rev 44288)
+++ trunk/libgdiplus/src/ChangeLog 2005-05-09 16:16:49 UTC (rev 44289)
@@ -1,3 +1,16 @@
+2005-05-09 Duncan Mak <[EMAIL PROTECTED]>
+
+ * graphics.c (make_pie, GdipDrawArc): when evaluating angles,
+ always use abs(). This fixes the drawing of arcs and pies when the
+ sweep angle is negative.
+
+ Bug #63360 has also been fixed. This was a bug reported by
+ Ravindra in August '04 about a hang when "the difference between
+ width and height of rectangle is 1 and angles sum is close to
+ 360". My change doesn't affect this bug. #63360 didn't hang in
+ libgdiplus 1.1.7 as is, so it was actually fixed by the Cairo
+ guys.
+
2005-05-06 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
* image.c: Only free memory blocks that are owned by us
Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c 2005-05-09 16:04:01 UTC (rev 44288)
+++ trunk/libgdiplus/src/graphics.c 2005-05-09 16:16:49 UTC (rev 44289)
@@ -247,7 +247,7 @@
cy + ry * sin_alpha);
/* just make an ellipse if we're going a full 2 PI (360 degrees) */
- if (sweepAngle >= 360) {
+ if (abs (sweepAngle) >= 360) {
make_ellipse (graphics, x, y, width, height);
return;
}
@@ -256,7 +256,7 @@
* draw the arc, if the sweep is bigger than 180, draw it
* twice, using a middle angle.
*/
- if (sweepAngle < 180)
+ if (abs (sweepAngle) < 180)
make_arc (graphics, TRUE, x, y, width, height, startAngle,
endAngle);
else {
float midAngle = startAngle + (sweepAngle / 2.0);
@@ -556,10 +556,10 @@
*/
/* just make an ellipse if we're going a full 360 degrees */
- if (sweepAngle >= 360)
+ if (abs (sweepAngle) >= 360)
make_ellipse (graphics, x, y, width, height);
- else if (sweepAngle < 180)
+ else if (abs (sweepAngle) < 180)
make_arc (graphics, TRUE, x, y, width, height, startAngle,
endAngle);
else {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches