summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-20 03:00:48 +0000
committerNorbert Preining <norbert@preining.info>2019-12-20 03:00:48 +0000
commit18d9ec0eba21e6b8c55cdd50afb91c56e02ce7bf (patch)
tree56de5f55a6575a68557d5a384f57e3e8566c536d /graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
parent3b24b0599bb35e1a3338fa33bfb24044a6125ba4 (diff)
CTAN sync 201912200300
Diffstat (limited to 'graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex')
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex31
1 files changed, 22 insertions, 9 deletions
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
index 4e0ba4f536..b4dda6fa1c 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
@@ -212,7 +212,7 @@ must set up the box |\pgfnodepartXYZbox|. The box will be placed at the anchor
Finally, when the node is drawn, the boxes are placed at the anchor
positions |text| and |lower|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{shapes}}]
\setbox\pgfnodeparttextbox=\hbox{$q_1$}
\setbox\pgfnodepartlowerbox=\hbox{01}
\begin{pgfpicture}
@@ -552,7 +552,7 @@ commands:
|\pgfpointanchor| without any transformations in force. Here is an example:
%
\makeatletter
-\begin{codeexample}[]
+\begin{codeexample}[pre={\makeatletter}]
\begin{pgfpicture}
\pgftransformrotate{30}
\pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}}
@@ -726,7 +726,7 @@ similar to the above:
area. Note that excessive use of this option (keeping track of dozens of
bounding boxes at the same time) will slow things down.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{scopes}}]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
{ [local bounding box=outer box]
@@ -1100,11 +1100,21 @@ The following command declares a new shape:
|\pgfpointshapeborder| command, the \meta{code} will be executed to
discern this point. When the execution of the \meta{code} starts, the
dimensions |\pgf@x| and |\pgf@y| will have been set to a location $p$
- in the shape's coordinate system. It is now the job of the \meta{code}
- to set up |\pgf@x| and |\pgf@y| such that they specify the point on the
- shape's border that lies on a straight line from the shape's center to
- the point $p$. Usually, this is a somewhat complicated computation,
- involving many case distinctions and some basic math.
+ in the shape's coordinate system, and relative to the anchor |center|.
+ Note that |\pgfpointshapeborder| will produce an error if the shape does
+ not contain the |center| anchor.
+
+ It is now the job of the \meta{code} to set up |\pgf@x| and |\pgf@y|
+ such that they specify the point on the shape's border that lies on a
+ straight line from the shape's center to the point $p$. Usually, this is
+ a somewhat complicated computation, involving many case distinctions and
+ some basic math. Note that the output coordinates must be returned in the
+ shape's coordinate system, \emph{no longer} relative to the |center|
+ anchor. While these different points of reference are only noticeable if
+ the |center| anchor is not at the origin of the shape's coordinate system,
+ it implies that ``doing nothing'' as a border anchor, i.e., returning the
+ point that was fed to |\pgfpointshapeborder| requires adding the |center|
+ anchor to the input coordinates.
For our |simple rectangle| we must compute a point on the border of a
rectangle whose one corner is the origin (ignoring the depth for
@@ -1240,7 +1250,10 @@ The following command declares a new shape:
on inheritance:
%
\makeatletter
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{shapes.geometric}},
+ pre={\makeatletter},
+]
\pgfdeclareshape{document}{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]