summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-05-25 11:48:47 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-05-25 11:48:47 +0200
commit8b678f473da7b81842dbc13b50c6303991570521 (patch)
tree53bc0e1c76c99a32011118c8941bab7b6e9b91df /tex/context/base/mkiv/mlib-ctx.lua
parentcaee9d5ac3c65f78671a9786318358cd647247eb (diff)
downloadcontext-8b678f473da7b81842dbc13b50c6303991570521.tar.gz
2019-05-25 10:53:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-ctx.lua')
-rw-r--r--tex/context/base/mkiv/mlib-ctx.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/mlib-ctx.lua b/tex/context/base/mkiv/mlib-ctx.lua
index 89f2fa0ee..e19f111b4 100644
--- a/tex/context/base/mkiv/mlib-ctx.lua
+++ b/tex/context/base/mkiv/mlib-ctx.lua
@@ -245,6 +245,8 @@ implement {
arguments = "string",
}
+-- this has to become a codeinjection
+
function metapost.getclippath(specification) -- why not a special instance for this
local mpx = metapost.pushformat(specification)
local data = specification.data or ""
@@ -304,7 +306,14 @@ end
implement {
name = "mpsetclippath",
actions = function(specification)
- setmacro("MPclippath",metapost.theclippath(specification),"global")
+ local p = specification.data and metapost.theclippath(specification)
+ if not p or p == "" then
+ local b = number.dimenfactors.bp
+ local w = b * (specification.width or 0)
+ local h = b * (specification.height or 0)
+ p = formatters["0 0 m %.6N 0 l %.6N %.6N l 0 %.6N l"](w,w,h,h)
+ end
+ setmacro("MPclippath",p,"global")
end,
arguments = {
{
@@ -316,6 +325,8 @@ implement {
{ "inclusions" },
{ "method" },
{ "namespace" },
+ { "width", "dimension" },
+ { "height", "dimension" },
},
}
}