From b2d922c78d39c2793d930aff7fe2cd3f963a385d Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Fri, 20 Sep 2024 07:12:11 +1200 Subject: [PATCH] Fix a compile bug in update scroll containers --- clay.h | 1 + examples/raylib-sidebar-scrolling-container/main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clay.h b/clay.h index 7f0ae78..f5299a7 100644 --- a/clay.h +++ b/clay.h @@ -3038,6 +3038,7 @@ void Clay_Initialize(Clay_Arena arena, Clay_Dimensions layoutDimensions) { CLAY_WASM_EXPORT("Clay_UpdateScrollContainers") void Clay_UpdateScrollContainers(bool enableDragScrolling, Clay_Vector2 scrollDelta, float deltaTime) { + bool isPointerActive = enableDragScrolling && (Clay__pointerInfo.state == CLAY__POINTER_INFO_PRESSED || Clay__pointerInfo.state == CLAY__POINTER_INFO_PRESSED_THIS_FRAME); // Don't apply scroll events to ancestors of the inner element int32_t highestPriorityElementIndex = -1; Clay__ScrollContainerDataInternal *highestPriorityScrollData = CLAY__NULL; diff --git a/examples/raylib-sidebar-scrolling-container/main.c b/examples/raylib-sidebar-scrolling-container/main.c index 41eae20..e0f94b8 100644 --- a/examples/raylib-sidebar-scrolling-container/main.c +++ b/examples/raylib-sidebar-scrolling-container/main.c @@ -167,7 +167,7 @@ void UpdateDrawFrame(void) } } - Clay_UpdateScrollContainers(false, (Clay_Vector2) {mouseWheelX, mouseWheelY}, GetFrameTime()); + Clay_UpdateScrollContainers(true, (Clay_Vector2) {mouseWheelX, mouseWheelY}, GetFrameTime()); // Generate the auto layout for rendering double currentTime = GetTime(); Clay_RenderCommandArray renderCommands = CreateLayout();