-
Notifications
You must be signed in to change notification settings - Fork 59
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
yscale=-1
causes incorrect drawing of bipoles
#211
Comments
Hmmm... the problem is that This behavior was the same in at least 0.8.3, so it's not a regression, at least. It's a bug, but I am not sure on how to tackle it. |
Thanks, this isn't high priority at all so don't worry if it takes some time. I converted my breadboard layout to use negative y which is actually more intuitive for displacements. |
This is really complex, and it goes all way back at least to 0.6. I am trying to understand exactly what's happening, but touching the main code in To see real fireworks, try to play with: \documentclass[]{article}
\usepackage{circuitikz-0.4}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) to [D, l=D1] (0, 2);
\draw (0, 0) to [D, l=D2] (2, 0);
\draw (0, 0) to [D, l=D3] (3, 3);
\path (0,0) node[draw]{A};
\path (0,2) node[draw]{B};
\path (2,0) node[draw]{C};
\end{tikzpicture}
\bigskip
\begin{tikzpicture}[
% rotate=45,
xscale = 2,
% scale = 2,
% transform shape, every node/.style={transform shape}
]
\draw (0, 0) to [D, l=D1] (0, 2);
\draw (0, 0) to [D, l=D2] (2, 0);
\draw (0, 0) to [D, l=D3] (3, 3);
\path (0,0) node[draw]{A};
\path (0,2) node[draw]{B};
\path (2,0) node[draw]{C};
\end{tikzpicture}
\end{document}
So for now I conclude that I will leave this here, opened, in the hope that I can find the time to rewrite all the code |
Also, The problem is the I will merge a documentation update for now, see PR #217 |
Also, @Rmano, you can probably make branches on the main repo as a collaborator, right? Helps with discovery, and you don't need to resync your fork's master every time you want to make a PR :) |
I prefer (probably because my git skills are quite basic) to branch on my fork to test things... and let the main repository clean. I fear that it could become like some other projects I'm in and that have grown to a forest, really... |
A lot of time ago there was a |
Asked a question on tex.stackexchange.com https://tex.stackexchange.com/questions/501929/tikz-angle-calculation-and-rotation-with-transformed-coordinates |
Well, with the help of @marmot of tex.stackexchange.com, I prepared a patch that seems to fix this issue. It's a quite scary thing, changing a basic part of the package, but... the problem is that it now breaks everything if |
Ok, I hacked something out in #257. I'd really appreciate testing on this, because it's scary. It should not change anything when not needed, but you know... With this change, the original snippet renders as this:
renders like: which seems correct. Moreover, the longish example: \documentclass[]{article}
\usepackage{circuitikz}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) to [D, l=D1, a=A1] (0, 3);
\draw (0, 0) to [D, l=D2, a=A2] (3, 0);
\draw (0, 0) to [D, l=D3, a=A3] (3, 3);
\path (0,0) node[draw]{A};
\path (0,3) node[draw]{B};
\path (3,0) node[draw]{C};
\end{tikzpicture}
\bigskip
\typeout{Now the scaling one:}
\begin{tikzpicture}[
% rotate=30,
xscale = 2,
% yscale = -1,
% scale = 2,
% transform shape,
% every node/.style={transform shape}
]
\draw (0, 0) to [D, l=D1, a=A1, ] (0, 3);
\draw (0, 0) to [D, l=D2, a=A2, ] (3, 0);
\draw (0, 0) to [D, l=D3, a=A3, ] (3, 3);
\path (0,0) node[draw]{A};
\path (0,3) node[draw]{B};
\path (3,0) node[draw]{C};
\end{tikzpicture}
\typeout{Now the rotating one:}
\begin{tikzpicture}[
rotate=30,
% xscale = 2,
% scale = 2,
% transform shape, every node/.style={transform shape}
]
\draw (0, 0) to [D, l=D1, a=A1, ] (0, 3);
\draw (0, 0) to [D, l=D2, a=A2, ] (3, 0);
\draw (0, 0) to [D, l=D3, a=A3, ] (3, 3);
\path (0,0) node[draw]{A};
\path (0,3) node[draw]{B};
\path (3,0) node[draw]{C};
\end{tikzpicture}
\begin{circuitikz}[american, rotate=-20,
transform shape,
]
\draw (0,0) -- ++(1,0) to[R=R] ++(2,0)
to [rmeterwa, t=A, i=$i$] ++(0,-2) node[ground]{};
\draw (1,0) to[rmeterwa, t=V, v=$v$] ++(0,-2) node[ground]{};
\end{circuitikz}
\end{document} produces |
MWE:
The first
tikzpicture
has noyscale=-1
, and the resistors are both drawn normally. However, in the second, there is a vertical line through both resistors; I suspect this is because the resistor are being drawn without theyscale=-1
option, even when it is set globally.Is there any change to
circuitikz
that could fix this, or should I just work with no y-flip, on the negative y-axis?The text was updated successfully, but these errors were encountered: