Translate group bounding box if it is placed outside of the current canvas

This is an attempt to fix #3879.
I don't know if this is the best way to solve the issue, but it does work as it should.