summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/tikzlibrarythrough.code.tex
blob: 986235b75b0df28ae789dc129ea663f35671ddc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Copyright 2018 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS{tikzlibrarythrough.code.tex}



\tikzset{circle through/.code={%
    \pgfkeysalso{shape=circle,inner sep=0pt,outer sep=0pt}%
    % Save transformations (correct?)
    \pgfgettransform{\tikz@lib@saved@transform}%
    \tikz@scan@one@point\tikz@lib@circle@through#1%
  }}%

\def\tikz@lib@circle@through#1{%
  \tikz@addoption{%
    {%
      \pgfsettransform{\tikz@lib@saved@transform}%
      \pgf@process{\pgfpointtransformed{#1}}%
      \pgf@xa=\pgf@x%
      \pgf@ya=\pgf@y%
      \pgf@process{\pgfpointtransformed{\tikz@node@at}}%
      \advance\pgf@xa by-\pgf@x%
      \advance\pgf@ya by-\pgf@y%
      \pgfmathparse{2*veclen(\the\pgf@xa,\the\pgf@ya)}%
      \global\let\tikz@lib@circle@size=\pgfmathresult%
    }%
    \pgfset{/pgf/minimum size/.expanded=\tikz@lib@circle@size}%
  }%
}%