From b29311c7cacf17b3512d837951d9e02fceae586f Mon Sep 17 00:00:00 2001 From: Doyle Date: Tue, 6 Oct 2020 05:16:23 +1100 Subject: mouse: Return float movement for precise scrolling where possible (#1397) --- projects/Geany/raylib.c.tags | 2 +- projects/Notepad++/c_raylib.xml | 2 +- projects/Notepad++/raylib_npp_parser/raylib_npp.xml | 2 +- projects/Notepad++/raylib_npp_parser/raylib_to_parse.h | 2 +- projects/VS2017.UWP/raylib.App.UWP/App.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'projects') diff --git a/projects/Geany/raylib.c.tags b/projects/Geany/raylib.c.tags index 33864ca0..1b47efdd 100644 --- a/projects/Geany/raylib.c.tags +++ b/projects/Geany/raylib.c.tags @@ -103,7 +103,7 @@ GetMousePosition|Vector2|(void);| SetMousePosition|void|(int x, int y);| SetMouseOffset|void|(int offsetX, int offsetY);| SetMouseScale|void|(float scaleX, float scaleY);| -GetMouseWheelMove|int|(void);| +GetMouseWheelMove|float|(void);| GetTouchX|int|(void);| GetTouchY|int|(void);| GetTouchPosition|Vector2|(int index);| diff --git a/projects/Notepad++/c_raylib.xml b/projects/Notepad++/c_raylib.xml index e77d1edc..8deab87e 100644 --- a/projects/Notepad++/c_raylib.xml +++ b/projects/Notepad++/c_raylib.xml @@ -436,7 +436,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index 06f1ee13..b5e9c69a 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -571,7 +571,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 1240cd5b..7ef12f93 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -147,7 +147,7 @@ RLAPI Vector2 GetMousePosition(void); // Returns mouse p RLAPI void SetMousePosition(int x, int y); // Set mouse position XY RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y +RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y // Input-related functions: touch RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index bf1898a9..05bad920 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -213,7 +213,7 @@ void App::GameLoop() DisableCursor(); } - static int pos = 0; + static float pos = 0; pos -= GetMouseWheelMove(); //---------------------------------------------------------------------------------- @@ -235,7 +235,7 @@ void App::GameLoop() if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK); if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); - DrawRectangle(280, pos + 50, 20, 20, BLACK); + DrawRectangle(280, (int)pos + 50, 20, 20, BLACK); DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); EndDrawing(); -- cgit v1.2.3