This fixes artifacts when we're scrolling inside scaled content, and includes a test for that (which fails without this code change).