implemented clipping to fix bug where current shape's grid extends past the edge