Mercurial > MadButterfly
changeset 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 |
files | nodejs/shapes.cc nodejs/shapes.m4 |
diffstat | 2 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/nodejs/shapes.cc Sat Aug 07 22:28:17 2010 +0800 +++ b/nodejs/shapes.cc Sat Aug 07 22:33:02 2010 +0800 @@ -19,11 +19,14 @@ * @{ */ static void -xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Value> blks, const char **err) { +xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Object> self, + Handle<Value> blks, const char **err) { Array *blksobj; Array *blkobj; mb_style_blk_t *mb_blks; int nblks; + Handle<Object> rt; + redraw_man_t *rdman; int r; int i; @@ -43,6 +46,13 @@ return; } + /* + * Mark changed. + */ + rt = GET(self, "mbrt")->ToObject(); + ASSERT(rt != NULL); + rdman = xnjsmb_rt_rdman(rt); + if(sh_get_coord(sh)) rdman_shape_changed(rdman, sh);
--- a/nodejs/shapes.m4 Sat Aug 07 22:28:17 2010 +0800 +++ b/nodejs/shapes.m4 Sat Aug 07 22:33:02 2010 +0800 @@ -12,7 +12,7 @@ STRUCT([stext], [shape_t], [], [METHOD([set_text], [sh_stext_set_text], (STR([txt])), 1, []), METHOD([set_style], [xnjsmb_sh_stext_set_style], - (ARRAY([blks]), ERR), 1, [])], + (SELF, ARRAY([blks]), ERR), 1, [])], (([INHERIT], [shape]))) STRUCT([image], [shape_t], [], [], (([INHERIT], [shape])))