summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-05-05 12:00:16 +0300
committerMarius <mariausol@gmail.com>2012-05-05 12:00:16 +0300
commitb8bc4fc22157f43c15f40d784ab05bdd30c93c44 (patch)
treef096b894c12456009b4c8b63ade35013c6751960 /metapost
parente80abdc4f40ec9a4bc9f5faad4d86f8dbf19f96f (diff)
downloadcontext-b8bc4fc22157f43c15f40d784ab05bdd30c93c44.tar.gz
beta 2012.05.05 10:42
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mpiv24
1 files changed, 24 insertions, 0 deletions
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index 43e620cfa..f89e7a491 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -591,3 +591,27 @@ enddef ;
% property p ; p = properties(withcolor (1,1,0,1)) ;
% fill fullcircle scaled 20cm withproperties p ;
+
+% Experimental:
+
+primarydef t asgroup s = % s = isolated|knockout
+ begingroup
+ save savedpicture ;
+ picture savedpicture ;
+ save currentbounds ;
+ path currentbounds ;
+ savedpicture := if picture t : t else : image(draw t) fi ;
+ currentbounds := boundingbox savedpicture ;
+ image (
+ draw currentbounds
+ withprescript "gr_state=start"
+ withprescript "gr_type=" & s
+ withprescript "gr_llx=" & decimal xpart llcorner currentbounds
+ withprescript "gr_lly=" & decimal ypart llcorner currentbounds
+ withprescript "gr_urx=" & decimal xpart urcorner currentbounds
+ withprescript "gr_ury=" & decimal ypart urcorner currentbounds ;
+ draw savedpicture ;
+ draw currentbounds
+ withprescript "gr_state=stop" ;
+ ) endgroup
+enddef ;