diff options
Diffstat (limited to 'metapost')
| -rw-r--r-- | metapost/context/base/mpiv/mp-tool.mpiv | 30 | 
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 ;  | 
