Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spy anchor does not affect magnified box #767

Closed
PhelypeOleinik opened this issue Nov 3, 2019 · 0 comments
Closed

Spy anchor does not affect magnified box #767

PhelypeOleinik opened this issue Nov 3, 2019 · 0 comments

Comments

@PhelypeOleinik
Copy link
Member

PhelypeOleinik commented Nov 3, 2019

The code:

\documentclass[tikz]{standalone}
\usetikzlibrary{spy}
\begin{document}
\begin{tikzpicture}[
    spy using outlines = {%
      magnification = 2,
      size = 3cm,
      connect spies,
      anchor = north, % <==
    }
  ]
  \coordinate (top) at (3,5);
  \draw (0,0) sin (top) cos (6,0);
  \spy on (top.north) in node at (3,2);
\end{tikzpicture}
\end{document}

produces:
test
where the spied on square doesn't match the magnified one. Notice that the in the top square the line touches the upper edge, but in the magnified square the line goes through the middle.

The code works correctly if I comment anchor = north. If I brute-force change the line:

path picture={\node[anchor=center,tikz@lib@reset@gs]{\nullfont%

to read:

    path picture={\node[anchor=south,tikz@lib@reset@gs]{\nullfont%

instead, then the output is correct (only when anchor = north, of course).

I'm guessing that the anchor option in that node should account for the anchor of the upper node as well.

@hmenke hmenke added the spy label Nov 3, 2019
@hmenke hmenke added this to the 3.1.5 milestone Nov 3, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Nov 4, 2019
Does not cover all cases, but I don't think there is a proper solution
for that.  It also can't do angles or @auto anchor.
@hmenke hmenke closed this as completed Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants