ticket #108: fixed mouse position detection when the viewport offset is not (0,0)