Fix a compile bug in update scroll containers

This commit is contained in:
Nic Barker 2024-09-20 07:12:11 +12:00
parent f17afc387a
commit b2d922c78d
2 changed files with 2 additions and 1 deletions

1
clay.h
View File

@ -3038,6 +3038,7 @@ void Clay_Initialize(Clay_Arena arena, Clay_Dimensions layoutDimensions) {
CLAY_WASM_EXPORT("Clay_UpdateScrollContainers") CLAY_WASM_EXPORT("Clay_UpdateScrollContainers")
void Clay_UpdateScrollContainers(bool enableDragScrolling, Clay_Vector2 scrollDelta, float deltaTime) { 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 // Don't apply scroll events to ancestors of the inner element
int32_t highestPriorityElementIndex = -1; int32_t highestPriorityElementIndex = -1;
Clay__ScrollContainerDataInternal *highestPriorityScrollData = CLAY__NULL; Clay__ScrollContainerDataInternal *highestPriorityScrollData = CLAY__NULL;

View File

@ -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 // Generate the auto layout for rendering
double currentTime = GetTime(); double currentTime = GetTime();
Clay_RenderCommandArray renderCommands = CreateLayout(); Clay_RenderCommandArray renderCommands = CreateLayout();