Mercurial > hg > orthanc-stone
changeset 1249:964c89e15e7e broker
ViewportController::HandleMouseMove() returning a Boolean for invalidation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jan 2020 14:23:24 +0100 |
parents | 2a8359503f3b |
children | a8248b08115c |
files | Framework/Scene2DViewport/ViewportController.cpp Framework/Scene2DViewport/ViewportController.h Framework/Viewport/WebAssemblyViewport.cpp |
diffstat | 3 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Scene2DViewport/ViewportController.cpp Tue Jan 07 13:45:04 2020 +0100 +++ b/Framework/Scene2DViewport/ViewportController.cpp Tue Jan 07 14:23:24 2020 +0100 @@ -278,11 +278,16 @@ } } - void ViewportController::HandleMouseMove(const PointerEvent& event) + bool ViewportController::HandleMouseMove(const PointerEvent& event) { if (activeTracker_) { activeTracker_->PointerMove(event); + return true; + } + else + { + return false; } }
--- a/Framework/Scene2DViewport/ViewportController.h Tue Jan 07 13:45:04 2020 +0100 +++ b/Framework/Scene2DViewport/ViewportController.h Tue Jan 07 14:23:24 2020 +0100 @@ -204,8 +204,9 @@ unsigned int viewportWidth, unsigned int viewportHeight); - // Must be expressed in canvas coordinates - void HandleMouseMove(const PointerEvent& event); + // Must be expressed in canvas coordinates. Returns "true" if the + // state has changed, so that "Invalidate()" can be called. + bool HandleMouseMove(const PointerEvent& event); // Must be expressed in canvas coordinates void HandleMouseRelease(const PointerEvent& event);
--- a/Framework/Viewport/WebAssemblyViewport.cpp Tue Jan 07 13:45:04 2020 +0100 +++ b/Framework/Viewport/WebAssemblyViewport.cpp Tue Jan 07 14:23:24 2020 +0100 @@ -160,8 +160,10 @@ { PointerEvent pointer; ConvertMouseEvent(pointer, *mouseEvent, *that.compositor_); - that.controller_->HandleMouseMove(pointer); - that.Invalidate(); + if (that.controller_->HandleMouseMove(pointer)) + { + that.Invalidate(); + } } return true;