# HG changeset patch # User Thinker K.F. Li # Date 1282268089 -28800 # Node ID 5ac257be7bc0cb03e48ebcf98130f45c12df3f4d # Parent 163f0d9e6382b049b4b5c75fd541e247e415d28f Testcase for linear and radial paint for JS diff -r 163f0d9e6382 -r 5ac257be7bc0 nodejs/testcase.js --- 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);