|
From: <hez...@us...> - 2010-03-13 17:28:20
|
Revision: 10861
http://plplot.svn.sourceforge.net/plplot/?rev=10861&view=rev
Author: hezekiahcarty
Date: 2010-03-13 17:28:14 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
Re-use the poly_line function to avoid code duplication
Modified Paths:
--------------
trunk/drivers/cairo.c
Modified: trunk/drivers/cairo.c
===================================================================
--- trunk/drivers/cairo.c 2010-03-13 17:27:27 UTC (rev 10860)
+++ trunk/drivers/cairo.c 2010-03-13 17:28:14 UTC (rev 10861)
@@ -426,6 +426,7 @@
set_line_properties( aStream, CAIRO_LINE_JOIN_BEVEL, CAIRO_LINE_CAP_BUTT );
poly_line( pls, xa, ya, npts );
+
cairo_stroke( aStream->cairoContext );
set_line_properties( aStream, old_join, old_cap );
@@ -1242,9 +1243,8 @@
set_line_properties( aStream, CAIRO_LINE_JOIN_BEVEL, CAIRO_LINE_CAP_BUTT );
/* Draw the polygons */
- cairo_move_to( aStream->cairoContext, aStream->downscale * (double) xa[0], aStream->downscale * (double) ya[0] );
- for ( i = 1; i < npts; i++ )
- cairo_line_to( aStream->cairoContext, aStream->downscale * (double) xa[i], aStream->downscale * (double) ya[i] );
+ poly_line( pls, xa, ya, npts );
+
cairo_set_source_rgba( aStream->cairoContext,
(double) pls->curcolor.r / 255.0,
(double) pls->curcolor.g / 255.0,
@@ -1301,10 +1301,8 @@
}
/* Draw the polygon using the gradient. */
+ poly_line( pls, xa, ya, npts );
- cairo_move_to( aStream->cairoContext, aStream->downscale * (double) xa[0], aStream->downscale * (double) ya[0] );
- for ( i = 1; i < npts; i++ )
- cairo_line_to( aStream->cairoContext, aStream->downscale * (double) xa[i], aStream->downscale * (double) ya[i] );
cairo_set_source( aStream->cairoContext, linear_gradient );
cairo_fill( aStream->cairoContext );
cairo_pattern_destroy( linear_gradient );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|