Author: spouliot
Date: 2006-05-15 14:57:48 -0400 (Mon, 15 May 2006)
New Revision: 60717
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/pen.c
Log:
2006-05-15 Sebastien Pouliot <[EMAIL PROTECTED]>
* pen.c: Added an hack to keep the "bad" behaviour in the most common
MWF usage (i.e. where the badness isn't visible).
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2006-05-15 18:39:59 UTC (rev 60716)
+++ trunk/libgdiplus/src/ChangeLog 2006-05-15 18:57:48 UTC (rev 60717)
@@ -1,3 +1,8 @@
+2006-05-15 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * pen.c: Added an hack to keep the "bad" behaviour in the most common
+ MWF usage (i.e. where the badness isn't visible).
+
2006-05-15 Sebastien Pouliot <[EMAIL PROTECTED]>
* pen.c: Revert the change from r52463. This looks better only when
Modified: trunk/libgdiplus/src/pen.c
===================================================================
--- trunk/libgdiplus/src/pen.c 2006-05-15 18:39:59 UTC (rev 60716)
+++ trunk/libgdiplus/src/pen.c 2006-05-15 18:57:48 UTC (rev 60717)
@@ -84,9 +84,19 @@
}
static cairo_line_cap_t
-convert_line_cap (GpLineCap cap)
+convert_line_cap (GpPen *pen)
{
- switch (cap) {
+ switch (pen->line_cap) {
+
+ /* HACK - this keeps SWF (mostly) happy with results very similar to
GDI+
+ * (under those specific cases) and also keeps the pen's
functionalities
+ * on par with GDI+
+ */
+ case LineCapFlat:
+ if (pen->dash_array || (pen->width != 1.0))
+ return CAIRO_LINE_CAP_BUTT;
+ else
+ return CAIRO_LINE_CAP_SQUARE;
case LineCapSquare:
return CAIRO_LINE_CAP_SQUARE;
@@ -94,7 +104,6 @@
case LineCapRound:
return CAIRO_LINE_CAP_ROUND;
- case LineCapFlat:
case LineCapTriangle:
case LineCapNoAnchor:
case LineCapSquareAnchor:
@@ -163,7 +172,7 @@
cairo_set_miter_limit (graphics->ct, (double) pen->miter_limit);
cairo_set_line_join (graphics->ct, convert_line_join (pen->line_join));
- cairo_set_line_cap (graphics->ct, convert_line_cap (pen->line_cap));
+ cairo_set_line_cap (graphics->ct, convert_line_cap (pen));
if (pen->dash_count > 0) {
double *dash_array;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches