mirror of
https://github.com/nicbarker/clay.git
synced 2025-09-18 04:26:18 +00:00
fix: scroll reset bug
This commit is contained in:
parent
1bc5105272
commit
3378ee17da
2
clay.h
2
clay.h
|
@ -4109,7 +4109,6 @@ void Clay_UpdateScrollContainers(bool enableDragScrolling, Clay_Vector2 scrollDe
|
|||
Clay__ScrollContainerDataInternalArray_RemoveSwapback(&context->scrollContainerDatas, i);
|
||||
continue;
|
||||
}
|
||||
scrollData->openThisFrame = false;
|
||||
Clay_LayoutElementHashMapItem *hashMapItem = Clay__GetHashMapItem(scrollData->elementId);
|
||||
// Element isn't rendered this frame but scroll offset has been retained
|
||||
if (!hashMapItem) {
|
||||
|
@ -4117,6 +4116,7 @@ void Clay_UpdateScrollContainers(bool enableDragScrolling, Clay_Vector2 scrollDe
|
|||
continue;
|
||||
}
|
||||
|
||||
scrollData->openThisFrame = false;
|
||||
// Touch / click is released
|
||||
if (!isPointerActive && scrollData->pointerScrollActive) {
|
||||
float xDiff = scrollData->scrollPosition.x - scrollData->scrollOrigin.x;
|
||||
|
|
Loading…
Reference in a new issue