Skip to content
Permalink
Browse files

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
  • Loading branch information
darktohka authored and rdb committed Mar 13, 2020
1 parent 9966dda commit 32a9ea2ceffe3a0bc1e3c9672a79e58af54fcf77
Showing with 1 addition and 1 deletion.
  1. +1 −1 direct/src/gui/DirectScrolledList.py
@@ -210,7 +210,7 @@ def scrollTo(self, index, centered=0):
numItemsVisible = self["numItemsVisible"]
numItemsTotal = len(self["items"])
if(centered):
self.index = index - (numItemsVisible/2)
self.index = index - (numItemsVisible // 2)
else:
self.index = index

0 comments on commit 32a9ea2

Please sign in to comment.
You can’t perform that action at this time.