author | francesco-ST <francesco.abbate@st.com> | 2010年08月05日 11:44:13 +0200 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2010年08月05日 11:44:13 +0200 |
commit | 342f6c89dc388883f174e37627fb013190311a2d (patch) | |
tree | 69f0f53f1905f81fe9a223dfabe0d69f6ac9ec26 /agg-plot/lua-draw.cpp | |
parent | b97c9e9c54cc38397a53fd3b9331f10907adcb4c (diff) | |
download | gsl-shell-342f6c89dc388883f174e37627fb013190311a2d.tar.gz |
-rw-r--r-- | agg-plot/lua-draw.cpp | 35 |
diff --git a/agg-plot/lua-draw.cpp b/agg-plot/lua-draw.cpp index e7a3c4ea..81079905 100644 --- a/agg-plot/lua-draw.cpp +++ b/agg-plot/lua-draw.cpp @@ -61,7 +61,7 @@ static int agg_path_index (lua_State *L); static int agg_text_free (lua_State *L); static int agg_text_set_text (lua_State *L); static int agg_text_set_point (lua_State *L); -// static int agg_text_rotate (lua_State *L); +static int agg_text_angle (lua_State *L); static int agg_rgba_free (lua_State *L); static int agg_rgba_add (lua_State *L); @@ -105,8 +105,8 @@ static const struct luaL_Reg rgba_methods[] = { static const struct luaL_Reg agg_text_methods[] = { {"__gc", agg_text_free}, {"set_point", agg_text_set_point}, - {"set_text", agg_text_set_text}, - // {"rotate", agg_text_rotate}, + {"text", agg_text_set_text}, + {"angle", agg_text_angle}, {NULL, NULL} }; @@ -234,27 +234,6 @@ agg_path_index (lua_State *L) return 0; } -/* NB: for the moment we have only one kind of "scalable" object. */ -scalable * -check_agg_scalable (lua_State *L, int index) -{ - int tplist[] = {GS_DRAW_PATH, GS_INVALID_TYPE}; - void *p = NULL; - int j; - - for (j = 0; tplist[j] != GS_INVALID_TYPE; j++) - { - p = gs_is_userdata (L, index, tplist[j]); - if (p) - break; - } - - if (p == NULL) - gs_type_error (L, index, "drawing object"); - - return (scalable *) p; -} - draw::text * check_agg_text (lua_State *L, int index) { @@ -294,20 +273,18 @@ agg_text_set_point (lua_State *L) draw::text *t = check_agg_text (L, 1); double x = luaL_checknumber (L, 2); double y = luaL_checknumber (L, 3); - t->self().start_point(x, y); + t->set_point(x, y); return 0; } -/* int -agg_text_rotate (lua_State *L) +agg_text_angle (lua_State *L) { draw::text *t = check_agg_text (L, 1); double a = luaL_checknumber (L, 2); - t->rotate(a); + t->set_angle(a); return 0; }; -*/ static unsigned int double2uint8 (double x) { |