summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pgf-blur
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-24 22:58:52 +0000
committerKarl Berry <karl@freefriends.org>2012-04-24 22:58:52 +0000
commitfc39aef8a74036c6969fa02b5f23fc1771d03b11 (patch)
tree03b548fa5a9da301a35e8eb3550be655480a864f /Master/texmf-dist/source/latex/pgf-blur
parent679addb84f37e5b8628eeee169409c95020cda99 (diff)
pgf-blur (24apr12)
git-svn-id: svn://tug.org/texlive/trunk@26125 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pgf-blur')
-rw-r--r--Master/texmf-dist/source/latex/pgf-blur/pgf-blur.dtx43
1 files changed, 29 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/pgf-blur/pgf-blur.dtx b/Master/texmf-dist/source/latex/pgf-blur/pgf-blur.dtx
index 54ca896b204..9f271907452 100644
--- a/Master/texmf-dist/source/latex/pgf-blur/pgf-blur.dtx
+++ b/Master/texmf-dist/source/latex/pgf-blur/pgf-blur.dtx
@@ -1,4 +1,4 @@
-% \iffalse meta-comment -*-mode:Latex;tex-command:"latex *;dvips -D600 pst-blur -o"-*-
+% \iffalse meta-comment -*-mode:Latex;tex-command:"pdflatex"-*-
%<*internal>
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
@@ -67,7 +67,7 @@ DESCRIPTION:
%</driver>
%\fi
%
-% \CheckSum{299}
+% \CheckSum{338}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -86,7 +86,8 @@ DESCRIPTION:
% Right brace \} Tilde \~}
%
%
-% \changes{v1.00}{2012/05/06}{First public release. (mg)}
+% \changes{v1.00}{2012/04/20}{First public release. (mg)}
+% \changes{v1.01}{2012/04/24}{Remove antialiasing/clipping artefacts (mg)}
%
% \DoNotIndex{\!,\",\#,\$,\%,\&,\',\(,\+,\*,\,,\-,\.,\/,\:,\;,\<,\=,\>,\?}
% \setcounter{IndexColumns}{2}
@@ -465,8 +466,8 @@ DESCRIPTION:
% import the original shadow code for the offset and scale parameters.
% \begin{macrocode}
%<*texfile>
-\def\fileversion{1.0}
-\def\filedate{2012/05/06}
+\def\fileversion{1.01}
+\def\filedate{2012/04/24}
\message{ v\fileversion, \filedate}
\usetikzlibrary{shadows}
\usetikzlibrary{calc}
@@ -493,7 +494,7 @@ DESCRIPTION:
/tikz/shadow blur extra rounding=\pgfutil@empty,
/tikz/shadow blur extra rounding/.default=\pgfbs@radius,
/tikz/shadow blur steps/.store in=\pgfbs@steps,
- /tikz/shadow blur steps=3,
+ /tikz/shadow blur steps=4,
/tikz/shadow opacity/.store in=\pgfbs@opacity,
/tikz/shadow opacity=40,
% \end{macrocode}
@@ -761,34 +762,48 @@ DESCRIPTION:
\pgfpicture
% fix bounding box.
\pgfbs@set@fading@pic@bbox
+ % compute increments for line width and opacity
+ \pgfmathsetmacro\pgfbs@op@step{50/\pgfbs@steps}
+ \pgfmathsetmacro\pgfbs@wth@step{4*\pgfbs@radius/(2*\pgfbs@steps-1)}
% draw the outer part of the fading,
% starting with lightest, outermost line
\pgfsetroundjoin
- \pgfmathsetmacro\pgfbs@max@i{\pgfbs@steps - 1}
+ \pgfmathsetmacro\pgfbs@max@i{\pgfbs@steps-2}
+ \pgfmathsetmacro\pgfbs@wth{2*\pgfbs@radius}
+ \pgfmathsetmacro\pgfbs@op{100-0.5*\pgfbs@op@step}
\foreach \pgfbs@i in {0,...,\pgfbs@max@i} {
- \pgfmathsetmacro\pgfbs@wth{%
- 2 * \pgfbs@radius * (1 - \pgfbs@i/\pgfbs@steps)}%
- \pgfmathsetmacro\pgfbs@op{%
- 100 - (25/\pgfbs@steps) * (2*\pgfbs@i + 1)}%
\pgfsetlinewidth{\pgfbs@wth pt}
\pgfsetstrokecolor{black!\pgfbs@op!pstb@shadow@color}
\pgfbs@usefadepath{stroke}
+ \pgfmathsetmacro\pgfbs@wth{\pgfbs@wth-\pgfbs@wth@step}
+ \global\let\pgfbs@wth=\pgfbs@wth
+ \pgfmathsetmacro\pgfbs@op{\pgfbs@op-\pgfbs@op@step}
+ \global\let\pgfbs@op=\pgfbs@op
}
% clip to inside of path
+ \scope
\pgfbs@usefadepath{clip}
% fill inside with final darkest shadow color
\pgfsetfillcolor{pstb@shadow@color}
\pgfbs@usebbox{fill}
% draw the inner part of the fading,
% starting with the darkest, innermost line
+ \pgfmathsetmacro\pgfbs@wth{2*\pgfbs@radius}
+ \pgfmathsetmacro\pgfbs@op{0.5*\pgfbs@op@step}
\foreach \pgfbs@i in {0,...,\pgfbs@max@i} {
- \pgfmathsetmacro\pgfbs@wth{%
- 2 * \pgfbs@radius * (1 - \pgfbs@i/\pgfbs@steps)}%
- \pgfmathsetmacro\pgfbs@op{(25/\pgfbs@steps) * (2*\pgfbs@i + 1)}
\pgfsetlinewidth{\pgfbs@wth pt}
\pgfsetstrokecolor{black!\pgfbs@op!pstb@shadow@color}
\pgfbs@usefadepath{stroke}
+ \pgfmathsetmacro\pgfbs@wth{\pgfbs@wth-\pgfbs@wth@step}
+ \global\let\pgfbs@wth=\pgfbs@wth
+ \pgfmathsetmacro\pgfbs@op{\pgfbs@op+\pgfbs@op@step}
+ \global\let\pgfbs@op=\pgfbs@op
}
+ \endscope
+ % a final stroke to hide clip/antialiasing artifcats
+ \pgfsetstrokecolor{black!50!pstb@shadow@color}
+ \pgfsetlinewidth{0.5*\pgfbs@wth@step}
+ \pgfbs@usefadepath{stroke}
\endpgfpicture
}
%</texfile>