Added clip propertiy for plots to turn on/off the clipping of plot area - 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-ST <francesco.abbate@st.com>2011年04月29日 12:04:09 +0200
committerfrancesco-ST <francesco.abbate@st.com>2011年05月02日 08:49:15 +0200
commita7096dd693d4042b27e33e616576f4f79f34ad39 (patch)
tree5206c62801f87b2961a9497005b50ed5c2be09a5 /agg-plot/lua-plot.cpp
parent5d6ade3d7faffa14aae1079d18490cc6015aca42 (diff)
downloadgsl-shell-a7096dd693d4042b27e33e616576f4f79f34ad39.tar.gz
Added clip propertiy for plots to turn on/off the clipping of plot area
Diffstat (limited to 'agg-plot/lua-plot.cpp')
-rw-r--r--agg-plot/lua-plot.cpp 24
1 files changed, 24 insertions, 0 deletions
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp
index 826204b6..d953ac50 100644
--- a/agg-plot/lua-plot.cpp
+++ b/agg-plot/lua-plot.cpp
@@ -63,6 +63,8 @@ static int plot_sync_mode_get (lua_State *L);
static int plot_sync_mode_set (lua_State *L);
static int plot_pad_mode_get (lua_State *L);
static int plot_pad_mode_set (lua_State *L);
+static int plot_clip_mode_get (lua_State *L);
+static int plot_clip_mode_set (lua_State *L);
static int canvas_new (lua_State *L);
@@ -101,6 +103,7 @@ static const struct luaL_Reg plot_properties_get[] = {
{"units", plot_units_get },
{"sync", plot_sync_mode_get },
{"pad", plot_pad_mode_get },
+ {"clip", plot_clip_mode_get },
{NULL, NULL}
};
@@ -109,6 +112,7 @@ static const struct luaL_Reg plot_properties_set[] = {
{"units", plot_units_set },
{"sync", plot_sync_mode_set },
{"pad", plot_pad_mode_set },
+ {"clip", plot_clip_mode_set },
{NULL, NULL}
};
@@ -437,6 +441,26 @@ static int plot_pad_mode_get (lua_State *L)
return 1;
}
+static int plot_clip_mode_set (lua_State *L)
+{
+ lua_plot *p = object_check<lua_plot>(L, 1, GS_PLOT);
+ bool request = (bool) lua_toboolean (L, 2);
+ AGG_LOCK();
+ p->set_clip_mode(request);
+ AGG_UNLOCK();
+ plot_update_raw (L, p, 1);
+ return 0;
+}
+
+static int plot_clip_mode_get (lua_State *L)
+{
+ lua_plot *p = object_check<lua_plot>(L, 1, GS_PLOT);
+ AGG_LOCK();
+ lua_pushboolean (L, p->clip_is_active());
+ AGG_UNLOCK();
+ return 1;
+}
+
int
plot_sync_mode_get (lua_State *L)
{
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月12日 16:58:13 +0000

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