Backends: Fixed early out on empty clip rect. In particular, DX12 backend would warn about it (others not so much). (#4775, #4464)

Amend/fix 2b0bd40b
This commit is contained in:
ocornut
2021-11-30 21:48:29 +01:00
parent f087a5b856
commit 440824d431
12 changed files with 12 additions and 11 deletions

View File

@ -164,7 +164,7 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
if (clip_max.x < clip_min.x || clip_max.y < clip_min.y)
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
SDL_Rect r = { (int)(clip_min.x), (int)(clip_min.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y) };