From 8b678f473da7b81842dbc13b50c6303991570521 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 25 May 2019 11:48:47 +0200 Subject: 2019-05-25 10:53:00 --- tex/context/base/mkiv/mlib-ctx.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tex/context/base/mkiv/mlib-ctx.lua') 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" }, }, } } -- cgit v1.2.3