From 61bbd91fab4c56959d29d40f15e8caa5798cb670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 30 Jun 2014 01:18:38 +0200 Subject: [PATCH] framebuffer: ignore mouse move event when nothing is pressed. I switched GLUT for SDL2 and didn't bother to test, apparently. --- src/framebuffer/FramebufferExample.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/framebuffer/FramebufferExample.cpp b/src/framebuffer/FramebufferExample.cpp index df30513b4..b19ed2b46 100644 --- a/src/framebuffer/FramebufferExample.cpp +++ b/src/framebuffer/FramebufferExample.cpp @@ -112,6 +112,8 @@ void FramebufferExample::mousePressEvent(MouseEvent& event) { } void FramebufferExample::mouseMoveEvent(MouseMoveEvent& event) { + if(!event.buttons()) return; + billboard->translate(camera->projectionSize()*Vector2(event.position()-previous)/Vector2(camera->viewport())*Vector2(2.0f, -2.0f)); previous = event.position(); redraw();