From 3b03a79f28cd6ab0149d4447ad7d7b8fd3542c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Hoz=C3=A1k?= <5235838+richardhozak@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:47:25 +0200 Subject: [PATCH] Fix scroll on mouse down being overriden by touch scroll (#42) --- examples/raylib-sidebar-scrolling-container/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/raylib-sidebar-scrolling-container/main.c b/examples/raylib-sidebar-scrolling-container/main.c index 37fa80d..bef69d3 100644 --- a/examples/raylib-sidebar-scrolling-container/main.c +++ b/examples/raylib-sidebar-scrolling-container/main.c @@ -141,7 +141,7 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- // Handle scroll containers Clay_Vector2 mousePosition = RAYLIB_VECTOR2_TO_CLAY_VECTOR2(GetMousePosition()); - Clay_SetPointerState(mousePosition, IsMouseButtonDown(0)); + Clay_SetPointerState(mousePosition, IsMouseButtonDown(0) && !scrollbarData.mouseDown); Clay_SetLayoutDimensions((Clay_Dimensions) { (float)GetScreenWidth(), (float)GetScreenHeight() }); if (!IsMouseButtonDown(0)) { scrollbarData.mouseDown = false;