Skip to content

Commit 47de75f

Browse files
committed
chore: add comments for Infinite
1 parent 3f25a4d commit 47de75f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/infinitegrid/src/Infinite.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { DIRECTION } from "./consts";
44
import { findIndex, findLastIndex, getNextCursors, isFlatOutline } from "./utils";
55

66

7+
// 파트의 가운데 부분을 중심으로 스크롤 하기 위한 함수
78
function getCenterPosByParts(parts: InfiniteItemPart[]) {
89
if (!parts.length) {
910
return 0;
@@ -486,6 +487,9 @@ export class Infinite extends Component<InfiniteEvents> {
486487
}
487488
return Math.max(0, ...items[length - 1].endOutline);
488489
}
490+
/**
491+
* 보이는 영역의 가운데를 기준으로 스크롤을 한다.
492+
*/
489493
public getVisibleAreaByParts(parts: InfiniteItemPart[]) {
490494
const nextParts = parts.map((part) => this.getItemPartByKey(part.key)).filter(Boolean);
491495

0 commit comments

Comments
 (0)