readd scrollcomp

This commit is contained in:
Min Idzelis 2025-03-25 11:26:19 +00:00
parent 06d7164ae9
commit 344c695b52

View File

@ -439,7 +439,15 @@ export class AssetBucket {
} }
} }
this.#bucketHeight = height; this.#bucketHeight = height;
store.updateIntersections(); if (store.topIntersectingBucket) {
const currentIndex = store.buckets.indexOf(store.topIntersectingBucket);
// if the bucket is 'before' the last intersecting bucket in the sliding window
// then adjust the scroll position by the delta, to compensate for the bucket
// size adjustment
if (currentIndex > 0 && index <= currentIndex) {
store.compensateScrollCallback?.(bucketHeightDelta);
}
}
} }
get bucketHeight() { get bucketHeight() {
return this.#bucketHeight; return this.#bucketHeight;