diff options
Diffstat (limited to 'tools/viewer/Viewer.cpp')
-rw-r--r-- | tools/viewer/Viewer.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 85b78baf8f..2355d985b3 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -897,24 +897,26 @@ bool Viewer::onTouch(intptr_t owner, Window::InputState state, float x, float y) } bool Viewer::onMouse(float x, float y, Window::InputState state, uint32_t modifiers) { - if (GestureDevice::kTouch == fGestureDevice) { - return false; - } - switch (state) { - case Window::kUp_InputState: { - fGesture.touchEnd(nullptr); - break; - } - case Window::kDown_InputState: { - fGesture.touchBegin(nullptr, x, y); - break; + if (!fSlides[fCurrentSlide]->onMouse(x, y, state, modifiers)) { + if (GestureDevice::kTouch == fGestureDevice) { + return false; } - case Window::kMove_InputState: { - fGesture.touchMoved(nullptr, x, y); - break; + switch (state) { + case Window::kUp_InputState: { + fGesture.touchEnd(nullptr); + break; + } + case Window::kDown_InputState: { + fGesture.touchBegin(nullptr, x, y); + break; + } + case Window::kMove_InputState: { + fGesture.touchMoved(nullptr, x, y); + break; + } } + fGestureDevice = fGesture.isBeingTouched() ? GestureDevice::kMouse : GestureDevice::kNone; } - fGestureDevice = fGesture.isBeingTouched() ? GestureDevice::kMouse : GestureDevice::kNone; fWindow->inval(); return true; } |