diff nodejs/testcase.js @ 643:a65720721c60

Fix issue of exception of internal field. img_ldr is a function to return a new img_ldr, not a constructor as in previous implementation. This changeset fix semantic error on xnjsmb_img_ldr_new().
author Thinker K.F. Li <thinker@branda.to>
date Wed, 28 Jul 2010 08:31:15 +0800
parents d45c928f6523
children c9f8c7e6f57e
line wrap: on
line diff
--- a/nodejs/testcase.js	Tue Jul 27 22:02:40 2010 +0800
+++ b/nodejs/testcase.js	Wed Jul 28 08:31:15 2010 +0800
@@ -11,6 +11,14 @@
 sys.puts("coord matrix: " + 
 	 [coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]]);
 
+/* Testcase for image shapes */
+var img = mb_rt.image_new(10, 10, 50, 50);
+var ldr = mbfly.img_ldr_new(".");
+var img_data = ldr.load("sample.png");
+var paint = mb_rt.paint_image_new(img_data);
+paint.fill(img);
+root.add_shape(img);
+
 sys.puts(mb_rt.path_new);
 var path = mb_rt.path_new("m 100,50 L 120,50 L 200,150 L 180,150 z");
 sys.puts(path);