always adjust for viewport size in mouse coords now
This commit is contained in:
parent
0c530a7e6a
commit
d3e33a8840
1 changed files with 2 additions and 6 deletions
|
@ -859,13 +859,9 @@ static void SdlDoEvent(const EventCallback &callbacks, SDL_Event &event)
|
|||
&& (event.motion.x != UI.MouseWarpPos.x || event.motion.y != UI.MouseWarpPos.y)) {
|
||||
int xw = UI.MouseWarpPos.x;
|
||||
int yw = UI.MouseWarpPos.y;
|
||||
#if (defined(USE_OPENGL) || defined(USE_GLES))
|
||||
// Scale mouse-coordinates to viewport
|
||||
if (ZoomNoResize) {
|
||||
xw = (Uint16)floorf(xw * float(Video.ViewportWidth) / Video.Width);
|
||||
yw = (Uint16)floorf(yw * float(Video.ViewportHeight) / Video.Height);
|
||||
}
|
||||
#endif
|
||||
xw = (Uint16)floorf(xw * float(Video.ViewportWidth) / Video.Width);
|
||||
yw = (Uint16)floorf(yw * float(Video.ViewportHeight) / Video.Height);
|
||||
UI.MouseWarpPos.x = -1;
|
||||
UI.MouseWarpPos.y = -1;
|
||||
SDL_WarpMouseInWindow(TheWindow, xw, yw);
|
||||
|
|
Loading…
Add table
Reference in a new issue