Mercurial > MadButterfly
diff nodejs/coord.cc @ 1451:5d89aa30310c
Revert changeset #2bcacd29d95f to remove unncessary functions
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 13 Apr 2011 14:38:25 +0800 |
parents | ef3908d9a3d2 |
children | 0cb89e204824 |
line wrap: on
line diff
--- a/nodejs/coord.cc Wed Apr 13 14:36:32 2011 +0800 +++ b/nodejs/coord.cc Wed Apr 13 14:38:25 2011 +0800 @@ -341,74 +341,6 @@ return Number::New(opacity); } -#define cc(i) (coord_get_matrix(coord)[i]) -static void -xnjsmb_coord_set_y(Handle<Object> self, coord_t *coord, Handle<Value> value, const char **str) -{ - Handle<Object> js_rt; - redraw_man_t *rdman; - co_aix y,ty; - co_aix xx,yy; - - js_rt = GET(self, "mbrt")->ToObject(); - ASSERT(js_rt != NULL); - rdman = xnjsmb_rt_rdman(js_rt); - - - ty = value->NumberValue(); - xx = GET(self,"_x")->ToNumber()->NumberValue(); - yy = GET(self,"_y")->ToNumber()->NumberValue(); - y = ty-cc(3)*xx-cc(4)*yy; - coord_get_matrix(coord)[5] = y; - rdman_coord_changed(rdman, coord); -} - -static Handle<Value> -xnjsmb_coord_get_y(Handle<Object> self, coord_t *coord, - const char **err) { - co_aix y; - co_aix xx,yy; - - xx = GET(self,"_x")->ToNumber()->NumberValue(); - yy = GET(self,"_y")->ToNumber()->NumberValue(); - - y = cc(3)*xx+cc(4)*yy+cc(5); - return Number::New(y); -} -static void -xnjsmb_coord_set_x(Handle<Object> self, coord_t *coord, Handle<Value> value, const char **str) -{ - Handle<Object> js_rt; - redraw_man_t *rdman; - co_aix x,tx; - co_aix xx,yy; - - xx = GET(self,"_x")->ToNumber()->NumberValue(); - yy = GET(self,"_y")->ToNumber()->NumberValue(); - js_rt = GET(self, "mbrt")->ToObject(); - ASSERT(js_rt != NULL); - rdman = xnjsmb_rt_rdman(js_rt); - - tx = value->NumberValue(); - x = tx-cc(0)*xx-cc(1)*yy; - coord_get_matrix(coord)[2] = x; - rdman_coord_changed(rdman, coord); -} - -static Handle<Value> -xnjsmb_coord_get_x(Handle<Object> self, coord_t *coord, - const char **err) { - co_aix x; - co_aix xx,yy; - - xx = GET(self,"_x")->ToNumber()->NumberValue(); - yy = GET(self,"_y")->ToNumber()->NumberValue(); - - x = cc(0)*xx+cc(1)*yy+cc(2); - return Number::New(x); -} -#undef m - #include "coord-inc.h" /*! \brief This function used by \ref xnjsmb_mb_rt to wrap coord object.