Improves legend resize