Cast to int where necessary
This commit is contained in:
parent
a4b2e74d25
commit
4eaa096576
@ -90,19 +90,19 @@ class WindowManager:
|
||||
if self._width_type is WindowManager.ABSOLUTE:
|
||||
width = self._width
|
||||
elif self._width_type is WindowManager.SCREEN_RELATIVE:
|
||||
width = screen_width * self._width
|
||||
width = int(screen_width * self._width)
|
||||
|
||||
if self._height_type is WindowManager.ABSOLUTE:
|
||||
height = self._height
|
||||
elif self._height_type is WindowManager.SCREEN_RELATIVE:
|
||||
height = screen_height * self._height
|
||||
height = int(screen_height * self._height)
|
||||
|
||||
if self._position is WindowManager.CENTER:
|
||||
x = (screen_width - width) / 2
|
||||
y = (screen_height - height) / 2
|
||||
x = int((screen_width - width) / 2)
|
||||
y = int((screen_height - height) / 2)
|
||||
elif self._position is WindowManager.LEFT:
|
||||
x = 0
|
||||
y = (screen_height - height) / 2
|
||||
y = int((screen_height - height) / 2)
|
||||
|
||||
self._window.move(x, y)
|
||||
self._window.resize(width, height)
|
||||
|
Loading…
Reference in New Issue
Block a user