Fix autoscroll regression (I should take padding into account).