14

The following code

\documentclass{article}
%\def\pgfsysdriver{pgfsys-dvipdfmx.def} %this line does not matter
\usepackage{tikz}\usetikzlibrary{shadows.blur}
\begin{document}
    \begin{tikzpicture}
        \draw[blur shadow](-2,0)circle(1);
        \draw[blur shadow](0,0)rectangle(3,2);
    \end{tikzpicture}
\end{document}

leads to

Only XeLaTeX produces this. It is fine with LaTeX and LuaLaTeX. Any idea to fix it?

  • 1
    This looks like an out-and-out bug in TikZ: have you reported it? – Joseph Wright Dec 17 '15 at 13:55
  • 1
    @JosephWright I guess I had a hard time telling it is TikZ's bug or pgf-blur's. Anycase, I just did it: sourceforge.net/p/pgf/bugs/375 – Symbol 1 Dec 18 '15 at 4:47
5

This is not a bug in pgf, but in pgf-blur. I found a working version here: http://bazaar.launchpad.net/~tex-sx/tex-sx/development/files made by Andrew Stacey. This version fixes some other bugs, too.

5

See also https://tex.stackexchange.com/a/445321/2388

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\makeatletter
\newcounter{shadowblurcount}
\tikzset{
  /tikz/render blur shadow/.code={
   \stepcounter{shadowblurcount}%
    \pgfbs@savebb
    \pgfsyssoftpath@getcurrentpath{\pgfbs@input@path}%
    \pgfbs@compute@shadow@bbox
    \pgfbs@process@rounding{\pgfbs@input@path}{\pgfbs@fadepath}%
    \pgfbs@apply@canvas@transform
    \colorlet{pstb@shadow@color}{white!\pgfbs@opacity!black}%
    \pgfdeclarefading{shadowfading\the\c@shadowblurcount}{\pgfbs@paint@fading}%
    \pgfsetfillcolor{black}%
    \pgfsetfading{shadowfading\the\c@shadowblurcount}%
       {\pgftransformshift{\pgfpoint{\pgfbs@midx}{\pgfbs@midy}}}%
    \pgfbs@usebbox{fill}%
    \pgfbs@restorebb
  },
  }
\makeatother
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\draw[blur shadow](-2,0)circle(1);
\draw[blur shadow](0,0)rectangle(3,2);
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.