I am using a matrix for node-positioning with a fixed node witdh. However, as some nodes contaning more than one line of text some nodes are shifted in y-axis and I don't know why or how to fix this. There seems to be enough space inside the node in y-axis. I also connected some nodes which result in an ugly picture.
MWE which shows this behaviour:
\documentclass[tikz]{standalone}
\usetikzlibrary{matrix,fit}
\begin{document}
\begin{tikzpicture}
\matrix (m) [%
matrix of nodes,%
nodes in empty cells,%
nodes={rectangle, draw ,align=center,minimum height=1.5cm, text width=3.5cm,font=\scriptsize, inner sep= 0cm, outer sep= 0cm, fill=white},%
column sep=.5cm,%
row sep=.5cm,%
anchor=center
]%
{
&{Two\\line\\breaks}&{One line}&& \\
{One\\linebreak}&&&& \\
&&&{Two\\line\\break}& \\
&&One&& \\
};
\foreach \row/\rownext in {1/2,2/3,3/4,4/4}
{
\foreach \col/\colnext in {1/2,2/3,3/4,4/5,5/5}
{
\draw(m-\row-\col) to (m-\row-\colnext);
\draw(m-\row-\col) to (m-\rownext-\col);
}
}
\end{tikzpicture}
\end{document}
Picture or result: