我对 Ti 的行为有点困惑钾Z 衰落。这是我的 MWE
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings}
\newcommand{\FadingQuarterArrowOne}[2][]{
\begin{scope}[transform canvas={rotate=#2},#1]
\shade [gray,path fading=south] (-40:1) -- (-40:1.2) arc (-40:40:1.2 and 1.2) --
(40:1.2) --(40:1.3) --
(45:1.1) -- (40:0.9) -- (40:1) arc (40:-40:1 and 1);
\end{scope}
}
\newcommand{\FadingQuarterArrowTwo}[2][]{
\begin{scope}[transform canvas={rotate=#2},#1]
\shade [gray,path fading=north] (40:1) -- (40:1.2) arc (40:-40:1.2 and 1.2) --
(-40:1.2) --(-40:1.3) --
(-45:1.1) -- (-40:0.9) -- (-40:1) arc (-40:40:1 and 1);
\end{scope}
}
\begin{document}
\tikz[baseline=(current bounding box.south)]{\FadingQuarterArrowOne[scale=2]{0}}
\hspace*{3cm}
\tikz[baseline=(current bounding box.south)]{\FadingQuarterArrowTwo[scale=2]{0}}
\end{document}
左箭头和我预期的一样,它向“南”方向逐渐消失。然而,第二个箭头与第一个箭头正好相反,它向外区域逐渐消失。我想知道为什么会发生这种情况,以及如何解决这个问题。
答案1
在左侧示例中,阴影从顶部(灰色)到底部(白色)。渐变south
遵循此方向并增强效果。
在正确情况下,阴影角度需要固定为 ,以shading angle=180
获得从底部(灰色)到顶部(白色)的阴影。然后,通过淡化到 来增强效果north
。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings}
\newcommand{\FadingQuarterArrowOne}[2][]{%
\begin{scope}[transform canvas={rotate=#2},#1]
\shade [gray,path fading=south]
(-40:1) -- (-40:1.2) arc (-40:40:1.2 and 1.2) --
(40:1.2) -- (40:1.3) --
(45:1.1) -- (40:0.9) -- (40:1) arc (40:-40:1 and 1);
\end{scope}%
}
\newcommand{\FadingQuarterArrowTwo}[2][]{%
\begin{scope}[transform canvas={rotate=#2},#1]
\shade [gray, shading angle=180, path fading=north]
(40:1) -- (40:1.2) arc (40:-40:1.2 and 1.2) --
(-40:1.2) -- (-40:1.3) --
(-45:1.1) -- (-40:0.9) -- (-40:1) arc (-40:40:1 and 1);
\end{scope}%
}
\begin{document}
\tikz[baseline=(current bounding box.south)]{\FadingQuarterArrowOne[scale=2]{0}}
\hspace*{3cm}
\tikz[baseline=(current bounding box.south)]{\FadingQuarterArrowTwo[scale=2]{0}}
\end{document}
这适用于 Acrobat Reader、xpdf、Ghostscript 和 Firefox。但 evince 2.32 显示错误结果,Google Chrome 显示空白页。