summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/tikzlibraryviews.code.tex
blob: 8ced1b64f3cfe4446894ed1fb00ee7976dff1207 (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
37
38
39
40
41
42
43
44
45
% 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{tikzlibraryviews.code.tex}


\tikzset{
  meet/.style={execute at begin scope={\tikz@lib@view@parse{meet}#1\pgf@stop},execute at end scope={\endpgfviewboxscope}},
  view/.style={meet = {#1}},
  slice/.style={execute at begin scope={\tikz@lib@view@parse{slice}#1\pgf@stop},execute at end scope={\endpgfviewboxscope}},
}%

\def\tikz@lib@view@parse#1#2\pgf@stop{%
  \tikz@scan@one@point\tikz@lib@view@a#2\pgf@stop%
  \pgfviewboxscope{\tikz@lib@view@stored@a}{\tikz@lib@view@stored@b}{\tikz@lib@view@stored@c}{\tikz@lib@view@stored@d}{#1}%
}%
\def\tikz@lib@view@a#1{%
  \def\tikz@lib@view@stored@a{#1}%
  \pgfutil@ifnextchar r{\tikz@lib@view@a@rec}{\tikz@scan@one@point\tikz@lib@view@b}%
}%
\def\tikz@lib@view@a@rec rectangle{\tikz@scan@one@point\tikz@lib@view@b}%
\def\tikz@lib@view@b#1{%
  \def\tikz@lib@view@stored@b{#1}%
  \pgfutil@ifnextchar\pgf@stop{%
    \let\tikz@lib@view@stored@c\tikz@lib@view@stored@a%
    \let\tikz@lib@view@stored@d\tikz@lib@view@stored@b%
    \pgfutil@gobble%
  }{\tikz@lib@view@b@at}%
}%
\def\tikz@lib@view@b@at at{\tikz@scan@one@point\tikz@lib@view@c}%
\def\tikz@lib@view@c#1{%
  \def\tikz@lib@view@stored@c{#1}%
  \pgfutil@ifnextchar r{\tikz@lib@view@c@rec}{\tikz@scan@one@point\tikz@lib@view@d}%
}%
\def\tikz@lib@view@c@rec rectangle{\tikz@scan@one@point\tikz@lib@view@d}%
\def\tikz@lib@view@d#1{\def\tikz@lib@view@stored@d{#1}\pgfutil@ifnextchar\pgf@stop\pgfutil@gobble{\tikzerror{Wrong syntax for meet or slice key}}}%


\endinput