sdl2: the size returned by setup_window mandate the one we try to set. When running on mobile or constrained env, the OS can force the size of the final window.

Plus, due to synced struct from latest SDL2 stable, x, y are not
integer but float. No need to divide now.
This commit is contained in:
Mathieu Virbel 2015-02-13 18:35:50 +01:00
parent fc204db8e9
commit 0cc176bb88
1 changed files with 2 additions and 3 deletions

View File

@ -77,8 +77,7 @@ class SDL2MotionEventProvider(MotionEventProvider):
return return
action, fid, x, y = value action, fid, x, y = value
x = x / 32768. y = 1 - y
y = 1 - (y / 32768.)
if fid not in touchmap: if fid not in touchmap:
touchmap[fid] = me = SDL2MotionEvent('sdl', fid, (x, y)) touchmap[fid] = me = SDL2MotionEvent('sdl', fid, (x, y))
else: else:
@ -143,7 +142,7 @@ class WindowSDL(WindowBase):
# setup ! # setup !
w, h = self._size w, h = self._size
resizable = Config.getboolean('graphics', 'resizable') resizable = Config.getboolean('graphics', 'resizable')
gl_size = self._win.setup_window(pos[0], pos[1], w, h, self._size = self._win.setup_window(pos[0], pos[1], w, h,
self.borderless, self.fullscreen, self.borderless, self.fullscreen,
resizable) resizable)
# never stay with a None pos, application using w.center # never stay with a None pos, application using w.center