Fix legend width bug introduced by 6752bf5c