gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/lua-plot.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年02月05日 16:09:32 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年02月05日 16:09:32 +0100
commit03c4b4f678eba6b41c35b90dfd15f5dfac247072 (patch)
treece94cd43505f1c09e0002214024ecb7910871426 /agg-plot/lua-plot.cpp
parent8a884e1444a053e7ae9dab850558a99879998df5 (diff)
downloadgsl-shell-03c4b4f678eba6b41c35b90dfd15f5dfac247072.tar.gz
Fix a bug that can lead to premature collection of marker objects
Diffstat (limited to 'agg-plot/lua-plot.cpp')
-rw-r--r--agg-plot/lua-plot.cpp 17
1 files changed, 14 insertions, 3 deletions
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)
{
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月14日 11:56:08 +0000

AltStyle によって変換されたページ (->オリジナル) /