diff --git a/demo/sdl_opengl2/nuklear_sdl_gl2.h b/demo/sdl_opengl2/nuklear_sdl_gl2.h index 067962b..2a885b5 100644 --- a/demo/sdl_opengl2/nuklear_sdl_gl2.h +++ b/demo/sdl_opengl2/nuklear_sdl_gl2.h @@ -240,8 +240,8 @@ nk_sdl_handle_grab(void) if (ctx->input.mouse.grab) { SDL_SetRelativeMouseMode(SDL_TRUE); } else if (ctx->input.mouse.ungrab) { - SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); SDL_SetRelativeMouseMode(SDL_FALSE); + SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); } else if (ctx->input.mouse.grabbed) { ctx->input.mouse.pos.x = ctx->input.mouse.prev.x; ctx->input.mouse.pos.y = ctx->input.mouse.prev.y; diff --git a/demo/sdl_opengl3/nuklear_sdl_gl3.h b/demo/sdl_opengl3/nuklear_sdl_gl3.h index 4b05003..7c847b1 100644 --- a/demo/sdl_opengl3/nuklear_sdl_gl3.h +++ b/demo/sdl_opengl3/nuklear_sdl_gl3.h @@ -349,8 +349,8 @@ nk_sdl_handle_grab(void) if (ctx->input.mouse.grab) { SDL_SetRelativeMouseMode(SDL_TRUE); } else if (ctx->input.mouse.ungrab) { - SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); SDL_SetRelativeMouseMode(SDL_FALSE); + SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); } else if (ctx->input.mouse.grabbed) { ctx->input.mouse.pos.x = ctx->input.mouse.prev.x; ctx->input.mouse.pos.y = ctx->input.mouse.prev.y; diff --git a/demo/sdl_opengles2/nuklear_sdl_gles2.h b/demo/sdl_opengles2/nuklear_sdl_gles2.h index 4e97fba..e3f4afb 100644 --- a/demo/sdl_opengles2/nuklear_sdl_gles2.h +++ b/demo/sdl_opengles2/nuklear_sdl_gles2.h @@ -349,8 +349,8 @@ nk_sdl_handle_grab(void) if (ctx->input.mouse.grab) { SDL_SetRelativeMouseMode(SDL_TRUE); } else if (ctx->input.mouse.ungrab) { - SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); SDL_SetRelativeMouseMode(SDL_FALSE); + SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); } else if (ctx->input.mouse.grabbed) { ctx->input.mouse.pos.x = ctx->input.mouse.prev.x; ctx->input.mouse.pos.y = ctx->input.mouse.prev.y; diff --git a/demo/sdl_renderer/nuklear_sdl_renderer.h b/demo/sdl_renderer/nuklear_sdl_renderer.h index e6dc24b..f2670bb 100644 --- a/demo/sdl_renderer/nuklear_sdl_renderer.h +++ b/demo/sdl_renderer/nuklear_sdl_renderer.h @@ -271,8 +271,8 @@ nk_sdl_handle_grab(void) if (ctx->input.mouse.grab) { SDL_SetRelativeMouseMode(SDL_TRUE); } else if (ctx->input.mouse.ungrab) { - SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); SDL_SetRelativeMouseMode(SDL_FALSE); + SDL_WarpMouseInWindow(sdl.win, (int)ctx->input.mouse.prev.x, (int)ctx->input.mouse.prev.y); } else if (ctx->input.mouse.grabbed) { ctx->input.mouse.pos.x = ctx->input.mouse.prev.x; ctx->input.mouse.pos.y = ctx->input.mouse.prev.y;