% Copyright 2006 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[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex,v 1.1 2008/02/03 19:37:27 tantau Exp $



\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}%
  }%
}