improve handling of scrolling constraints