Pass motion events in the unix sample app.

Allows dragging and flinging the samples.


git-svn-id: http://skia.googlecode.com/svn/trunk@964 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
scroggo 2011-03-18 22:09:01 +00:00
parent b66365f5dd
commit 001b972189

View File

@ -96,8 +96,8 @@ int main(){
window->handleClick(evt.xbutton.x, evt.xbutton.y, SkView::Click::kUp_State); window->handleClick(evt.xbutton.x, evt.xbutton.y, SkView::Click::kUp_State);
break; break;
case MotionNotify: case MotionNotify:
// 'If' statement is unnecessary, since we are only masking for button 1 // Since we are only masking to get the motion events for when Button1 is pressed,
if (evt.xbutton.button == Button1) // we can assume the pointer is moving with Button1 pressed.
window->handleClick(evt.xmotion.x, evt.xmotion.y, SkView::Click::kMoved_State); window->handleClick(evt.xmotion.x, evt.xmotion.y, SkView::Click::kMoved_State);
break; break;
case KeyPress: case KeyPress: