Fix typo in intersectRect
Check if rectangle is offscreen in Layout.resize
Move _createTile to layout

This was duplicated code