Browse Source

improved mousewheel support

Julianiolo 2 years ago
parent
commit
fa2b5db288
1 changed files with 5 additions and 4 deletions
  1. 5 4
      rlImGui.cpp

+ 5 - 4
rlImGui.cpp

@@ -116,10 +116,11 @@ static void rlImGuiNewFrame()
 	io.MouseDown[1] = IsMouseButtonDown(MOUSE_RIGHT_BUTTON);
 	io.MouseDown[2] = IsMouseButtonDown(MOUSE_MIDDLE_BUTTON);
 
-	if (GetMouseWheelMove() > 0)
-		io.MouseWheel += 1;
-	else if (GetMouseWheelMove() < 0)
-		io.MouseWheel -= 1;
+	{
+		Vector2 mouseWheel = GetMouseWheelMoveV();
+		io.MouseWheel += mouseWheel.y;
+		io.MouseWheelH += mouseWheel.x;
+	}
 
 	if ((io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) == 0)
 	{