Fix bug with X direction not respecting max width