summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-06-22 16:42:14 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-06-22 16:42:14 +0200
commitda8162d4e816cf49d9790a1c81556b499f442bed (patch)
tree5c631b1fb8282670a6cea1087afa766a8b94db43 /metapost
parent204057fdc5023b5f4ff55a69bc6593388ea427e7 (diff)
downloadcontext-da8162d4e816cf49d9790a1c81556b499f442bed.tar.gz
2018-06-22 16:02:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpiv/mp-luas.mpiv6
-rw-r--r--metapost/context/base/mpiv/mp-mlib.mpiv14
2 files changed, 19 insertions, 1 deletions
diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv
index 3bc95349d..d025848ca 100644
--- a/metapost/context/base/mpiv/mp-luas.mpiv
+++ b/metapost/context/base/mpiv/mp-luas.mpiv
@@ -56,13 +56,15 @@ vardef mlib_luas_luacall(text t) =
runscript("" for s = t :
if string s :
& s
-% & mfun_lua_bs & s & mfun_lua_es
+ % & mfun_lua_bs & s & mfun_lua_es
elseif numeric s :
& decimal s
elseif boolean s :
& if s : "true" else : "false" fi
elseif pair s :
& mfun_pair_to_table(s)
+ elseif path s :
+ & mfun_path_to_table(s)
elseif rgbcolor s :
& mfun_rgb_to_table(s)
elseif cmykcolor s :
@@ -90,6 +92,8 @@ vardef mlib_luas_lualist(expr c)(text t) =
& if s : "true" else : "false" fi
elseif pair s :
& mfun_pair_to_table(s)
+ elseif path s :
+ & mfun_path_to_table(s)
elseif rgbcolor s :
& mfun_rgb_to_table(s)
elseif cmykcolor s :
diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv
index 403b2d3ae..6fcc75d50 100644
--- a/metapost/context/base/mpiv/mp-mlib.mpiv
+++ b/metapost/context/base/mpiv/mp-mlib.mpiv
@@ -1489,6 +1489,20 @@ vardef mfun_pair_to_table(expr p) =
"}"
enddef ;
+vardef mfun_point_to_table(expr p,i) =
+ "{" & decimal xpart (point i of p) &
+ "," & decimal ypart (point i of p) &
+ "," & decimal xpart (precontrol i of p) &
+ "," & decimal ypart (precontrol i of p) &
+ "," & decimal xpart (postcontrol i of p) &
+ "," & decimal ypart (postcontrol i of p) &
+ "}"
+enddef ;
+
+vardef mfun_path_to_table(expr p) =
+ "{" & mfun_point_to_table(p,0) for i=1 upto length(p) : & "," & mfun_point_to_table(p,i) endfor & "}"
+enddef ;
+
vardef mfun_rgbcolor_to_table(expr c) =
"{" & decimal redpart c &
"," & decimal greenpart c &