Set back clipping_enabled

This commit is contained in:
Sylvain 2021-04-03 23:40:13 +02:00
parent 6b5cfe5f2b
commit fb698ba7ef
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E

View File

@ -112,6 +112,7 @@ nk_sdl_render(enum nk_anti_aliasing AA)
offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf);
SDL_Rect saved_clip;
SDL_bool clipping_enabled = SDL_RenderIsClipEnabled(sdl.renderer);
SDL_RenderGetClipRect(sdl.renderer, &saved_clip);
nk_draw_foreach(cmd, &sdl.ctx, &dev->cmds)
@ -142,6 +143,9 @@ nk_sdl_render(enum nk_anti_aliasing AA)
}
SDL_RenderSetClipRect(sdl.renderer, &saved_clip);
if (!clipping_enabled) {
SDL_RenderSetClipRect(sdl.renderer, NULL);
}
nk_clear(&sdl.ctx);
nk_buffer_clear(&dev->cmds);