add loop scroll

This commit is contained in:
hi80482 2020-07-29 23:32:08 +08:00 committed by GitHub
parent 4986c2b309
commit e8623f6189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,8 +318,7 @@ class RomListPage(Page):
# loop scroll, to end
if self._PsIndex == len(self._MyList) - 1:
# check items per page
if len(self._MyList) < self._ItemsPerPage:
self._ItemsPerPage = len(self._MyList)
if len(self._MyList) > self._ItemsPerPage:
self._ItemsPerPage -= 1 # not include current item
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height * (dy - self._ItemsPerPage)
@ -349,8 +348,7 @@ class RomListPage(Page):
# loop scroll, to first
if self._PsIndex == 0:
# check items per page
if len(self._MyList) < self._ItemsPerPage:
self._ItemsPerPage = len(self._MyList)
if len(self._MyList) > self._ItemsPerPage:
self._ItemsPerPage -= 1 # not include current item
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height * (dy - self._ItemsPerPage)