When using tikzpicture to draw a rectangle around subsets of matrix elements, how can I be sure of getting a rectangle, rather than a shape that has wonky sides because it takes account of the varying widths of the elements ?
For example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of math nodes] (m)
{1 & 1 & 1 \\
1 & 1 & -2 \\
1 & 1 & 1 \\};
\draw[rounded corners,ultra thick][color=blue]
(m-2-2.north west) -- (m-1-2.north west)
-- (m-1-3.north east) -- (m-2-3.south east) -- (m-2-2.south west) -- (m-2-2.north west);
\end{tikzpicture}
\end{document}
...gives a rectangle with a wonky right hand edge. This can be fixed by adding a white minus sign before the middle 1 in the top row (\color{white}-\color{black}1), but this unattractive kludge messes up the position of the 1!
Thanks for any help with this.
UPDATE
Many thanks to Heiko for the answer which solved the given example. But there remains a problem when a mid-row has long contents, e.g.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning,fit}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of math nodes] (m)
{1 & 1 & 1 \\
1 & 1.618034 & -2 \\
1 & 1 & 1 \\};
\node[draw=blue,inner sep=0pt,ultra thick,rounded corners,
fit=(m-1-2.north west) (m-1-3.north east)
(m-3-2.south west) (m-3-3.south east)
]{};
\end{tikzpicture}
\end{document}

