Mercurial > MadButterfly
comparison 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 |
comparison
equal
deleted
inserted
replaced
642:4f7b4ff31c0c | 643:a65720721c60 |
---|---|
8 sys.puts("root matrix: " + | 8 sys.puts("root matrix: " + |
9 [root[0], root[1], root[2], root[3], root[4], root[5]]); | 9 [root[0], root[1], root[2], root[3], root[4], root[5]]); |
10 var coord = mb_rt.coord_new(root); | 10 var coord = mb_rt.coord_new(root); |
11 sys.puts("coord matrix: " + | 11 sys.puts("coord matrix: " + |
12 [coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]]); | 12 [coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]]); |
13 | |
14 /* Testcase for image shapes */ | |
15 var img = mb_rt.image_new(10, 10, 50, 50); | |
16 var ldr = mbfly.img_ldr_new("."); | |
17 var img_data = ldr.load("sample.png"); | |
18 var paint = mb_rt.paint_image_new(img_data); | |
19 paint.fill(img); | |
20 root.add_shape(img); | |
13 | 21 |
14 sys.puts(mb_rt.path_new); | 22 sys.puts(mb_rt.path_new); |
15 var path = mb_rt.path_new("m 100,50 L 120,50 L 200,150 L 180,150 z"); | 23 var path = mb_rt.path_new("m 100,50 L 120,50 L 200,150 L 180,150 z"); |
16 sys.puts(path); | 24 sys.puts(path); |
17 sys.puts(coord.add_shape); | 25 sys.puts(coord.add_shape); |