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

Fitting a node doesn't respect rotation #191

Closed
pgf-tikz-bot opened this issue Jan 2, 2012 · 4 comments
Closed

Fitting a node doesn't respect rotation #191

pgf-tikz-bot opened this issue Jan 2, 2012 · 4 comments

Comments

@pgf-tikz-bot
Copy link

Migrated from SourceForge
Author: *anonymous
Timestamp: 2012-01-02 16:07:19

When fitting a node, a rotation given to \begin{tikzpicture} is ignored. See attachment:

If one leaves out [rotate=90], then all works fine. But with the rotation, the coordinates are rotated, but the node is fitted to some other coordinates.

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: *anonymous
Timestamp: 2012-01-02 16:07:20

https://sourceforge.net/p/pgf/bugs/_discuss/thread/13282150/32b3/attachment/mull.tex
Minimal Example for rotation irrespectful fitting node

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: cjorssen
Timestamp: 2012-01-05 12:55:41

Thanks for the report. Here is a workaround.

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{fit}
\begin{document}
\tikzset{inner sep=0pt,outer sep=0pt}
\makeatletter
\pgfkeys{%
/tikz/rotate/.forward to = /tikz/fit/rotation angle,
/tikz/fit/rotation angle/.initial = 0,
/tikz/fit rotated/.code = \def\tikz@lib@fit@rotate{%
\pgfkeysvalueof{/tikz/fit/rotation angle}}\tikz@lib@fit{#1}}
\makeatletter
\begin{tikzpicture}[rotate=90]
\coordinate (bar) at (0,0);
\coordinate (foo) at (2,1);
\draw[red](bar)--(foo);

\node[draw,fit=(bar) (foo)] {no rot};
\node[draw,fit rotated=(bar) (foo),red]{rot};
\end{tikzpicture}

\end{document}

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: tantau
Timestamp: 2013-07-12 17:36:21.742000

  • status: open --> closed-duplicate
  • Group: --> v1.0 (example)

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: tantau
Timestamp: 2013-07-12 17:36:22.509000

This is the same as bug #128, which is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant