[Core] Fix Clay_GetScrollOffset not finding the same element accross frames (#606)

This commit is contained in:
Bach Le 2026-05-06 07:55:57 +07:00 committed by GitHub
parent 30d051373c
commit e4aa952816
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

2
clay.h
View file

@ -4230,7 +4230,7 @@ Clay_Vector2 Clay_GetScrollOffset(void) {
Clay_LayoutElement *openLayoutElement = Clay__GetOpenLayoutElement();
for (int32_t i = 0; i < context->scrollContainerDatas.length; i++) {
Clay__ScrollContainerDataInternal *mapping = Clay__ScrollContainerDataInternalArray_Get(&context->scrollContainerDatas, i);
if (mapping->layoutElement == openLayoutElement) {
if (mapping->elementId == openLayoutElement->id) {
return mapping->scrollPosition;
}
}