Fix #11331 (hidden group still occupies space in composer legend)