summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-11-01 11:41:49 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-11-01 11:41:49 +0100
commit5a501d72ddc9ab9003746aa46fad3a12046e20ec (patch)
tree961dfe1070db46aa798ec0dc553f19b60f8355c6 /metapost
parentf0bc9c17c5298a3a4645f28a39273f52c27c646a (diff)
downloadcontext-5a501d72ddc9ab9003746aa46fad3a12046e20ec.tar.gz
2016-11-01 10:15:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpiv/mp-tool.mpiv30
1 files changed, 30 insertions, 0 deletions
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv
index e9eff8987..a4528a2f8 100644
--- a/metapost/context/base/mpiv/mp-tool.mpiv
+++ b/metapost/context/base/mpiv/mp-tool.mpiv
@@ -87,6 +87,36 @@ enddef ;
let triplet = rgbcolor ;
let quadruplet = cmykcolor ;
+%D Image redefined, for Alan:
+
+vardef image@#(text t) =
+ save currentpicture ;
+ picture currentpicture ;
+ currentpicture := nullpicture ;
+ t ;
+ currentpicture
+ shifted (mfun_labxf@#*lrcorner currentpicture +
+ mfun_labyf@#*ulcorner currentpicture +
+ (1-mfun_labxf@#-mfun_labyf@#)*llcorner currentpicture)
+enddef ;
+
+% 10% faster
+%
+% vardef image@#(text t) =
+% save currentpicture ;
+% picture currentpicture ;
+% currentpicture := nullpicture ;
+% t ;
+% currentpicture
+% if str @# <> "" :
+% shifted (
+% mfun_labxf@# * lrcorner currentpicture
+% + mfun_labyf@# * ulcorner currentpicture
+% + (1-mfun_labxf@#-mfun_labyf@#) * llcorner currentpicture
+% )
+% fi
+% enddef ;
+
%D Colors:
newinternal nocolormodel ; nocolormodel := 1 ;