fixed drawing buffer wrapping to be more consistent