Mercurial > MadButterfly
comparison nodejs/shapes.cc @ 689:a05a4a27ff46
Fix bug of losting rdman in xnjsmb_sh_stext_set_style
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 07 Aug 2010 22:33:02 +0800 |
parents | cadebc13be2f |
children | 86c6ebf1de25 |
comparison
equal
deleted
inserted
replaced
688:cadebc13be2f | 689:a05a4a27ff46 |
---|---|
17 * \ingroup xnjsmb | 17 * \ingroup xnjsmb |
18 * | 18 * |
19 * @{ | 19 * @{ |
20 */ | 20 */ |
21 static void | 21 static void |
22 xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Value> blks, const char **err) { | 22 xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Object> self, |
23 Handle<Value> blks, const char **err) { | |
23 Array *blksobj; | 24 Array *blksobj; |
24 Array *blkobj; | 25 Array *blkobj; |
25 mb_style_blk_t *mb_blks; | 26 mb_style_blk_t *mb_blks; |
26 int nblks; | 27 int nblks; |
28 Handle<Object> rt; | |
29 redraw_man_t *rdman; | |
27 int r; | 30 int r; |
28 int i; | 31 int i; |
29 | 32 |
30 blksobj = Array::Cast(*blks); | 33 blksobj = Array::Cast(*blks); |
31 nblks = blksobj->Length(); | 34 nblks = blksobj->Length(); |
40 r = sh_stext_set_style(sh, mb_blks, nblks); | 43 r = sh_stext_set_style(sh, mb_blks, nblks); |
41 if(r != 0) { | 44 if(r != 0) { |
42 *err = "Unknown error"; | 45 *err = "Unknown error"; |
43 return; | 46 return; |
44 } | 47 } |
48 | |
49 /* | |
50 * Mark changed. | |
51 */ | |
52 rt = GET(self, "mbrt")->ToObject(); | |
53 ASSERT(rt != NULL); | |
54 rdman = xnjsmb_rt_rdman(rt); | |
45 | 55 |
46 if(sh_get_coord(sh)) | 56 if(sh_get_coord(sh)) |
47 rdman_shape_changed(rdman, sh); | 57 rdman_shape_changed(rdman, sh); |
48 | 58 |
49 delete mb_blks; | 59 delete mb_blks; |