introduce predraw_ and move some logic there; panning now works