When scaling tikzpicture using option scale, some points that had equal coordinates appear to be shifted a little bit. So the precise comparision \ifdim \y1 = \y2 will not do anymore.
I'm aware of \pgfmathapproxequalto, but the problem is that dimensions are not plain numbers.
\pgfmathapproxequalto, but know that using dimensions instead of plain numbers is not a problem with the\pgfmath...macros. You can simply use it with dimensions:\pgfmathapproxequalto{1pt}{1pt}or even mixed:\pgfmathapproxequalto{1pt}{1}. Did you tried that and got an error? It works OK in my little tests. – Martin Scharrer♦ Apr 18 '11 at 6:55\themacro (\the\y1), which led me to errors. This problem is the consequence of this topic (tex.stackexchange.com/questions/15107/…). When scaling, I get the same artifacts, even when I check the points to be on horizontal or vertical line. – Dmitry F. Volosnykh Apr 18 '11 at 7:29