summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
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 ;