changeset 734:5ac257be7bc0

Testcase for linear and radial paint for JS
author Thinker K.F. Li <thinker@branda.to>
date Fri, 20 Aug 2010 09:34:49 +0800
parents 163f0d9e6382
children d0ee92a96c47
files nodejs/testcase.js
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/testcase.js	Fri Aug 20 09:34:49 2010 +0800
+++ b/nodejs/testcase.js	Fri Aug 20 09:34:49 2010 +0800
@@ -19,6 +19,22 @@
 paint.fill(img);
 root.add_shape(img);
 
+/* test linear paint and rectangle */
+var rect = mb_rt.rect_new(100, 100, 50, 50, 10, 10);
+sys.puts(mb_rt.paint_linear_new);
+var paint = mb_rt.paint_linear_new(100, 100, 150, 150);
+paint.set_stops([[0, 0, 1, 0, 1], [1, 0, 0, 1, 1]]);
+paint.fill(rect);
+root.add_shape(rect);
+
+/* test radial paint and rectangle */
+var rect = mb_rt.rect_new(150, 100, 50, 50, 10, 10);
+sys.puts(mb_rt.paint_radial_new);
+var paint = mb_rt.paint_radial_new(175, 125, 25);
+paint.set_stops([[0, 0, 1, 0, 1], [1, 0, 0, 1, 1]]);
+paint.fill(rect);
+root.add_shape(rect);
+
 /* test alpha blending and rectangle */
 var rect = mb_rt.rect_new(40, 40, 100, 100, 10, 10);
 sys.puts(mb_rt.paint_color_new);