Fixed mouse initial position and optimized hitTest()