26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
// Metro module 8138 (f8139).
|
|
export function lerpVarWidthThumbnailScrollBounds(a0, a1) {
|
|
if (a0.length === 0) {
|
|
return 0;
|
|
}
|
|
let r8 = a1;
|
|
if (a1 < 0) {
|
|
return 0;
|
|
}
|
|
if (a1 >= a0.length) {
|
|
r8 = a0.length;
|
|
}
|
|
const r7 = Math.floor(r8);
|
|
const r11 = r8 - r7;
|
|
if (r7 >= a0.length) {
|
|
return a0[a0.length - 1].scrollStart;
|
|
}
|
|
const scrollStart = a0[r7].scrollStart;
|
|
return scrollStart + r11 * ((r7 < a0.length - 1 ? a0[r7 + 1].scrollStart : scrollStart) - scrollStart);
|
|
}
|
|
lerpVarWidthThumbnailScrollBounds.__closure = {};
|
|
lerpVarWidthThumbnailScrollBounds.__workletHash = 5256874583737;
|
|
lerpVarWidthThumbnailScrollBounds.__initData = {
|
|
code: "function lerpVarWidthThumbnailScrollBounds_portraitThumbnailHelpersTsx1(positions,position){if(positions.length===0)return 0;if(position<0){return 0;}if(position>=positions.length){position=positions.length;}const index=Math.floor(position);const fraction=position-index;if(index>=positions.length){return positions[positions.length-1].scrollStart;}const startPos=positions[index].scrollStart;const endPos=index<positions.length-1?positions[index+1].scrollStart:startPos;return startPos+fraction*(endPos-startPos);}"
|
|
};
|