Cast from double to int in Scroll and Motion events