Skip to content

Commit 61bbd91

Browse files
committed
framebuffer: ignore mouse move event when nothing is pressed.
I switched GLUT for SDL2 and didn't bother to test, apparently.
1 parent 4534f99 commit 61bbd91

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/framebuffer/FramebufferExample.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ void FramebufferExample::mousePressEvent(MouseEvent& event) {
112112
}
113113

114114
void FramebufferExample::mouseMoveEvent(MouseMoveEvent& event) {
115+
if(!event.buttons()) return;
116+
115117
billboard->translate(camera->projectionSize()*Vector2(event.position()-previous)/Vector2(camera->viewport())*Vector2(2.0f, -2.0f));
116118
previous = event.position();
117119
redraw();

0 commit comments

Comments
 (0)