Minor performance improvement: only invalidate layout if the bounds width changes