From 7a3a0627c2b0c46e929ec98255457ca5ff5fc812 Mon Sep 17 00:00:00 2001 From: javasabr Date: Tue, 29 Mar 2016 06:48:40 +0300 Subject: [PATCH] fixed the scroll of mouse and the buffer overflow. --- .../src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java index bf5478cba..89f60fb7f 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java @@ -136,7 +136,7 @@ public class GlfwMouseInput implements MouseInput { glfwSetScrollCallback(context.getWindowHandle(), scrollCallback = new GLFWScrollCallback() { @Override public void invoke(final long window, final double xOffset, final double yOffset) { - onWheelScroll(window, xOffset, yOffset); + onWheelScroll(window, xOffset, yOffset * 120); } }); @@ -213,7 +213,7 @@ public class GlfwMouseInput implements MouseInput { // TODO: currently animated cursors are not supported IntBuffer imageData = jmeCursor.getImagesData(); - ByteBuffer buf = BufferUtils.createByteBuffer(imageData.capacity()); + ByteBuffer buf = BufferUtils.createByteBuffer(imageData.capacity() * 4); buf.asIntBuffer().put(imageData); glfwImage.set(jmeCursor.getWidth(), jmeCursor.getHeight(), buf);