[cairo-commit] cairo-java/test/org/freedesktop/cairo/test Snippets.java, 1.1, 1.2

Jeffrey Morgan commit at pdx.freedesktop.org
Fri Mar 4 15:38:18 PST 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/org/freedesktop/cairo/test
In directory gabe:/tmp/cvs-serv27118/test/org/freedesktop/cairo/test

Modified Files:
	Snippets.java 
Log Message:
added another snippet

Index: Snippets.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/org/freedesktop/cairo/test/Snippets.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Snippets.java	4 Mar 2005 20:34:47 -0000	1.1
+++ Snippets.java	4 Mar 2005 23:38:16 -0000	1.2
@@ -25,7 +25,8 @@
 		"arc_negative",
 		"clip",
 		"curve_to",
-		"curve_rectangle"
+		"curve_rectangle",
+		"fill_and_stroke"
 	};
 	
 	public static void invokeSnippet(Snippets snip, int num, Cairo cr, double width, double height) 
@@ -204,4 +205,24 @@
 		cr.setRGBColor(0.5, 0,0);
 		cr.stroke();
 	}
+
+	/**
+	 * fill_and_stroke snippet
+	 */
+	public void fill_and_stroke(Cairo cr, double width, double height) {
+		normalize(cr, width, height);
+
+		cr.moveTo(0.5, 0.1);
+		cr.lineTo(0.9, 0.9);
+		cr.relLineTo(-0.4, 0.0);
+		cr.curveTo(0.2, 0.9, 0.2, 0.5, 0.5, 0.5);
+
+		cr.save();
+		cr.setRGBColor(0, 0, 1);
+		cr.fill();
+		cr.restore();
+
+		cr.closePath();
+		cr.stroke();
+	}
 }




More information about the cairo-commit mailing list