dgui: Fix DirectScrolledList scrollTo error in Python 3

As a rule of thumb, Python 3 divisions always have float results. Unfortunately, this piece of code is still relying on the old Python 2.7 behavior.

Closes #880
This commit is contained in:
Derzsi Dániel 2020-03-13 22:37:25 +02:00 committed by rdb
parent 9966ddaa33
commit 32a9ea2cef

View File

@ -210,7 +210,7 @@ class DirectScrolledList(DirectFrame):
numItemsVisible = self["numItemsVisible"]
numItemsTotal = len(self["items"])
if(centered):
self.index = index - (numItemsVisible/2)
self.index = index - (numItemsVisible // 2)
else:
self.index = index