This commit is contained in:
Chen Lily 2024-07-12 14:57:06 +08:00
parent adbf4750cc
commit 6b1e74790b
Signed by: lchen
GPG Key ID: 750571FDD28B03CF

View File

@ -3537,7 +3537,13 @@ export class Grid {
} }
} }
_topToIndex(top) { /**
* @private
* @param {number} top
* @param {boolean} [reload]
* @returns {number}
*/
_topToIndex(top, reload) {
const rowHeight = (this.rowHeight + 1); const rowHeight = (this.rowHeight + 1);
top -= (top % (rowHeight * 2)) + (RedumCount * rowHeight); top -= (top % (rowHeight * 2)) + (RedumCount * rowHeight);
if (top < 0) { if (top < 0) {
@ -3561,7 +3567,7 @@ export class Grid {
* @returns {number} * @returns {number}
*/ */
_scrollToTop(top, reload) { _scrollToTop(top, reload) {
const tti = this._topToIndex(top); const tti = this._topToIndex(top, reload);
top = tti.top; top = tti.top;
if (this._var.scrollTop !== top) { if (this._var.scrollTop !== top) {
this._var.scrollTop = top; this._var.scrollTop = top;