author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年02月05日 16:09:32 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年02月05日 16:09:32 +0100 |
commit | 03c4b4f678eba6b41c35b90dfd15f5dfac247072 (patch) | |
tree | ce94cd43505f1c09e0002214024ecb7910871426 /agg-plot/lua-plot.cpp | |
parent | 8a884e1444a053e7ae9dab850558a99879998df5 (diff) | |
download | gsl-shell-03c4b4f678eba6b41c35b90dfd15f5dfac247072.tar.gz |
-rw-r--r-- | agg-plot/lua-plot.cpp | 17 |
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp index 5746a21d..8ba21bbc 100644 --- a/agg-plot/lua-plot.cpp +++ b/agg-plot/lua-plot.cpp @@ -184,11 +184,13 @@ plot_free (lua_State *L) } void -plot_add_gener_cpp (lua_State *L, sg_plot *p, bool as_line, - gslshell::ret_status& st) +plot_add_gener_cpp (lua_State *L, sg_plot* p, bool as_line, + gslshell::ret_status& st) { agg::rgba8 color; - sg_object* obj = parse_graph_args(L, color, st); + int layer_index = p->current_layer_index(); + + sg_object* obj = parse_graph_args(L, color, st, layer_index); if (!obj) return; @@ -205,6 +207,7 @@ objref_mref_add (lua_State *L, int table_index, int index, int value_index) { int n; INDEX_SET_ABS(L, table_index); + INDEX_SET_ABS(L, value_index); lua_rawgeti (L, table_index, index); if (lua_isnil (L, -1)) @@ -225,6 +228,14 @@ objref_mref_add (lua_State *L, int table_index, int index, int value_index) lua_pop (L, 1); } +void +plot_lua_add_ref (lua_State* L, int plot_index, int ref_index) +{ + lua_getfenv (L, plot_index); + objref_mref_add (L, -1, ref_index, -2); + lua_pop (L, 1); +} + int plot_add_gener (lua_State *L, bool as_line) { |