Improve the implementation for markers transforms - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/agg-parse-trans.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2011年12月18日 23:57:56 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2011年12月18日 23:57:56 +0100
commit1f073c45dc94bbd0a8df7ab8540bb0fe2fecfd6e (patch)
treef209ee59ac3729dd262783096349654ee12ebc62 /agg-plot/agg-parse-trans.cpp
parent5f093983d4e62111c97436bbb2ce7bf433d1fe7b (diff)
downloadgsl-shell-1f073c45dc94bbd0a8df7ab8540bb0fe2fecfd6e.tar.gz
Improve the implementation for markers transforms
Diffstat (limited to 'agg-plot/agg-parse-trans.cpp')
-rw-r--r--agg-plot/agg-parse-trans.cpp 28
1 files changed, 23 insertions, 5 deletions
diff --git a/agg-plot/agg-parse-trans.cpp b/agg-plot/agg-parse-trans.cpp
index 47ccdbe5..bad9e8ce 100644
--- a/agg-plot/agg-parse-trans.cpp
+++ b/agg-plot/agg-parse-trans.cpp
@@ -94,20 +94,38 @@ sg_object* build_marker (lua_State *L, int specindex, sg_object* src)
double size = mlua_named_optnumber(L, specindex, "size", 3.0);
lua_getfield(L, specindex, "mark");
- const char *sym_name = lua_tostring(L, -1);
sg_object *sym;
- if (!sym_name && gs_is_userdata(L, -1, GS_DRAW_SCALABLE))
+ if (lua_isnumber(L, -1))
{
- sg_object* obj = (sg_object*) lua_touserdata(L, -1);
- sym = new trans::scaling_a(obj);
+ int n = lua_tointeger(L, -1);
+ sym = new_marker_symbol(n);
}
else
{
- sym = new_marker_symbol(sym_name ? sym_name : "circle");
+ const char *sym_name = lua_tostring(L, -1);
+ if (!sym_name && gs_is_userdata(L, -1, GS_DRAW_SCALABLE))
+ {
+ sg_object* obj = (sg_object*) lua_touserdata(L, -1);
+ sym = new trans::scaling_a(obj);
+ }
+ else
+ {
+ sym = new_marker_symbol(sym_name ? sym_name : "circle");
+ }
}
lua_pop(L, 1);
+ lua_getfield(L, specindex, "outline");
+ bool outline = !lua_isnil(L, -1);
+ lua_pop(L, 1);
+
+ if (outline)
+ {
+ trans::stroke* stroke = new trans::stroke(sym);
+ sym = stroke;
+ }
+
return new trans::marker(src, size, sym);
}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 12:31:12 +0000

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