summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
committerMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
commitdbbbbfac3d158709a07af8c26e68284d1b0ea202 (patch)
treeb9cb25022fc2858c0dcbc190ad466ba89c69861d /metapost
parent7c7fe9c9e18355f42d0dba1b248235252728060b (diff)
downloadcontext-dbbbbfac3d158709a07af8c26e68284d1b0ea202.tar.gz
beta 2011.04.11 16:45
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mp18
-rw-r--r--metapost/context/base/mp-tool.mp1
2 files changed, 17 insertions, 2 deletions
diff --git a/metapost/context/base/mp-mlib.mp b/metapost/context/base/mp-mlib.mp
index e812df61e..11f096c18 100644
--- a/metapost/context/base/mp-mlib.mp
+++ b/metapost/context/base/mp-mlib.mp
@@ -31,6 +31,20 @@ newinternal lightentransparent ; lightentransparent := 10 ;
newinternal differencetransparent ; differencetransparent := 11 ;
newinternal exclusiontransparent ; exclusiontransparent := 12 ;
+vardef transparency_alternative_to_number(expr name) =
+ if string name :
+ if expandafter known scantokens(name & "transparent") :
+ scantokens(name & "transparent")
+ else :
+ 0
+ fi
+ elseif name < 13 :
+ name
+ else :
+ 0
+ fi
+enddef ;
+
def spotcolor(expr n, v) =
1
withprescript "sp_name=" & n
@@ -47,12 +61,12 @@ enddef ;
def transparent(expr alternative, transparency)(text c) =
c
- withprescript "tr_alternative=" & decimal alternative
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
withprescript "tr_transparency=" & decimal transparency
enddef ;
def withtransparency(expr alternative, transparency) =
- withprescript "tr_alternative=" & decimal alternative
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
withprescript "tr_transparency=" & decimal transparency
enddef ;
diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp
index 1a748baf9..7f047fefc 100644
--- a/metapost/context/base/mp-tool.mp
+++ b/metapost/context/base/mp-tool.mp
@@ -251,6 +251,7 @@ def newtransform text v = forsuffixes i=v : save i ; transform i ; endfor ; endd
def newpath text v = forsuffixes i=v : save i ; path i ; endfor ; enddef ;
def newpicture text v = forsuffixes i=v : save i ; picture i ; endfor ; enddef ;
def newstring text v = forsuffixes i=v : save i ; string i ; endfor ; enddef ;
+def newpair text v = forsuffixes i=v : save i ; pair i ; endfor ; enddef ;
%D Sometimes we don't want parts of the graphics add to the
%D bounding box. One way of doing this is to save the bounding