You could put an invisible rectangle on top with no fill and no stroke, then group everything.

An example

[![enter image description here][1]][1]

Another possibility is to use filled rectangles instead of lines with strokes. Personally, I'd prefer this method since it's by far the simplest.

[![enter image description here][2]][2]


  [1]: https://i.sstatic.net/x8FmO.png
  [2]: https://i.sstatic.net/BtVD9.png