소스 검색

add loop scroll

hi80482 3 년 전
부모
커밋
4986c2b309
1개의 변경된 파일10개의 추가작업 그리고 12개의 파일을 삭제
  1. 10 12
      sys.py/UI/Emulator/fav_list_page.py

+ 10 - 12
sys.py/UI/Emulator/fav_list_page.py

@@ -282,13 +282,12 @@ class FavListPage(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)
-            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)
+            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)
             self._Scrolled -= dy
-            self._ItemsPerPage = 6      # reset to 6
+            self._ItemsPerPage = 6                      # reset to 6
 
     def ScrollDown(self):
         if len(self._MyList) == 0:
@@ -311,13 +310,12 @@ class FavListPage(Page):
         # loop scroll, to first
         if self._PsIndex == 0:
             # check items per page
-            if len(self._MyList) < self._ItemsPerPage:
-                self._ItemsPerPage = len(self._MyList)
-            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)
+            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)
             self._Scrolled += dy
-            self._ItemsPerPage = 6      # reset to 6
+            self._ItemsPerPage = 6                      # reset to 6
     
     def SyncScroll(self):
         ##