Fix tile matrix bug

It happened when you had special tiles, and ignore map edges selected
and tried to draw a matrix on the edge of the map.