Fixes safe canvas issues introduced in r1153. When zoomed in to a high zoom level, scrolling appears to "shake" the screen by a pixel or two. Since translate() still takes float values, the scroll value is subject to rounding errors. To counteract that, we will calculate the rounding error when converting from float to int and adjust as necessary.