@ninebone/grid 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nine-grid.js CHANGED
@@ -27445,19 +27445,18 @@ class Dd {
27445
27445
  // 2. 스크롤 위치에 따른 행 인덱스 및 오프셋 조회 (이진 탐색)
27446
27446
  getRowInfoAt(C) {
27447
27447
  const t = f(this, Ds);
27448
- if (!t || t.length === 0) return { index: 0, offset: 0 };
27448
+ if (!t || t.length < 2) return { index: 0, offset: 0 };
27449
27449
  if (C <= 0) return { index: 0, offset: 0 };
27450
27450
  if (C >= t[t.length - 1])
27451
27451
  return { index: t.length - 2, offset: t[t.length - 1] - t[t.length - 2] };
27452
27452
  let l = 0, c = t.length - 2, o = 0;
27453
27453
  for (; l <= c; ) {
27454
- let n = Math.floor((l + c) / 2);
27455
- t[n] <= C ? (o = n, l = n + 1) : c = n - 1;
27454
+ let r = Math.floor((l + c) / 2);
27455
+ t[r] <= C ? (o = r, l = r + 1) : c = r - 1;
27456
27456
  }
27457
- const r = t[o] || 0;
27458
- return {
27457
+ return o = Math.max(0, Math.min(o, t.length - 2)), {
27459
27458
  index: o,
27460
- offset: C - r
27459
+ offset: C - (t[o] || 0)
27461
27460
  };
27462
27461
  }
27463
27462
  }