diff options
Diffstat (limited to 'Master/texmf-dist/metapost/roundrect/roundrect.mp')
-rw-r--r-- | Master/texmf-dist/metapost/roundrect/roundrect.mp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Master/texmf-dist/metapost/roundrect/roundrect.mp b/Master/texmf-dist/metapost/roundrect/roundrect.mp index 6dbde535544..66c385e4943 100644 --- a/Master/texmf-dist/metapost/roundrect/roundrect.mp +++ b/Master/texmf-dist/metapost/roundrect/roundrect.mp @@ -33,6 +33,8 @@ numeric rrbotrtborderrad; rrbotrtborderrad := 40pt; numeric rrbotlftborderrad; rrbotlftborderrad := 40pt; numeric rrtoplftborderrad; rrtoplftborderrad := 40pt; numeric rrtextwd; rrtextwd := 0; +numeric rrshadowx; rrshadowx := rrbotrtborderrad/4; +numeric rrshadowy; rrshadowy := -rrbotrtborderrad/4; string rrtextfont; rrtextfont := "\fontsize{10pt}{12pt}\selectfont "; color rrtextcolor; rrtextcolor := black; string rrbodytext; rrbodytext := ""; @@ -41,10 +43,12 @@ boolean rrnotop; rrnotop := false; boolean rrnobot; rrnobot := false; boolean rrnolft; rrnolft := false; boolean rrnort; rrnort := false; +boolean rrdropshadow; rrdropshadow := false; color rrtopbordercolor; rrtopbordercolor := black; color rrbotbordercolor; rrbotbordercolor := black; color rrlftbordercolor; rrlftbordercolor := black; color rrrtbordercolor; rrrtbordercolor := black; +color rrshadowcolor; rrshadowcolor := black; def rrbordercolor(expr x) = rrtopbordercolor := x; rrbotbordercolor := x; @@ -81,6 +85,10 @@ rrtextfont := "\fontsize{10pt}{12pt}\selectfont "; rrtextcolor := black; rrbodytext := ""; rrtextalign; rrtextalign := "\centering"; +rrdropshadow := false; +rrshadowcolor := black; +rrshadowx := rrbotrtborderrad/4; +rrshadowy := -rrbotrtborderrad/4; enddef; def roundrect(expr rrht, rrwd)(suffix name) = TEXPRE("%&latex" & char(10) & "\documentclass{article}\begin{document}"); @@ -126,9 +134,21 @@ rrtopborder := rrtoplftcorner--rrtoprtcorner; rrbotborder := rrbotrtcorner--rrbotlftcorner; rrlftborder := rrbotlftcorner--rrtoplftcorner; rrrtborder := rrtoprtcorner--rrbotrtcorner; -name := image(fill rrtoplftcorner--rrtoprtcorner-- +picture rrdropshadowpic; +if (rrdropshadow = true): +rrdropshadowpic := image(fill rrtoplftcorner--rrtoprtcorner-- +rrbotrtcorner--rrbotlftcorner--cycle +shifted (rrshadowx,rrshadowy) withcolor +rrshadowcolor); +else: +rrdropshadowpic := currentpicture; +fi +name := currentpicture; +addto name also rrdropshadowpic; +rrdropshadowpic := image(fill rrtoplftcorner--rrtoprtcorner-- rrbotrtcorner--rrbotlftcorner--cycle withcolor rrinnercolor); +addto name also rrdropshadowpic; picture rrtmpborder; border := currentpicture; if (rrnotop = false): |