From 45cfa0b242b3e9149b76141832ffed2330194fe4 Mon Sep 17 00:00:00 2001 From: Jan Tiemann Date: Fri, 13 Sep 2024 13:33:00 +0200 Subject: [PATCH] GLFWMouseAndKeyHandler + Test: remove unused function --- .../scenery/controls/GLFWMouseAndKeyHandler.kt | 16 ---------------- .../unit/controls/GLFWMouseAndKeyHandlerTests.kt | 3 +-- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/kotlin/graphics/scenery/controls/GLFWMouseAndKeyHandler.kt b/src/main/kotlin/graphics/scenery/controls/GLFWMouseAndKeyHandler.kt index 1ab3b13be..500fb289d 100644 --- a/src/main/kotlin/graphics/scenery/controls/GLFWMouseAndKeyHandler.kt +++ b/src/main/kotlin/graphics/scenery/controls/GLFWMouseAndKeyHandler.kt @@ -384,22 +384,6 @@ open class GLFWMouseAndKeyHandler(var hub: Hub?) : MouseAndKeyHandlerBase(), Aut activeButtonDrags.clear() } - /** - * Called when the mouse is dragged, evaluates current drag behaviours - * - * @param[e] The incoming mouse event - */ - fun mouseDragged(e: MouseEvent) { - update() - - val x = e.x - val y = e.y - - for (drag in activeButtonDrags) { - drag.behaviour.drag(x, y) - } - } - /** * Called when the mouse is exiting, updates state * diff --git a/src/test/kotlin/graphics/scenery/tests/unit/controls/GLFWMouseAndKeyHandlerTests.kt b/src/test/kotlin/graphics/scenery/tests/unit/controls/GLFWMouseAndKeyHandlerTests.kt index 446679aa2..e49f2ffb0 100644 --- a/src/test/kotlin/graphics/scenery/tests/unit/controls/GLFWMouseAndKeyHandlerTests.kt +++ b/src/test/kotlin/graphics/scenery/tests/unit/controls/GLFWMouseAndKeyHandlerTests.kt @@ -456,7 +456,6 @@ class GLFWMouseAndKeyHandlerTests { glfwHandler.mousePressed(clickEvent) moveEvents.forEach { move -> glfwHandler.mouseMoved(move) - glfwHandler.mouseDragged(move) } glfwHandler.mouseReleased(releaseEvent) @@ -466,7 +465,7 @@ class GLFWMouseAndKeyHandlerTests { assertEquals(start, dragStart, "Expected dragging start to be") assertEquals(end, dragEnd, "Expected dragging end to be") - assertEquals(dragCount * 2, actualDrags, "Expected $dragCount events to have happened") + assertEquals(dragCount, actualDrags, "Expected $dragCount events to have happened") } }