calculates the visible cells and boundary column/row numbers that are needed for the expansion