Skip to content

Commit bd9868f

Browse files
committed
Scrollbar: Avoid rendering when sizes are negative to reduce glitches (not sure how this ever slipped through - perhaps because of WindowMinSize settings).
1 parent df52f46 commit bd9868f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

imgui.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,8 @@ static void Scrollbar(ImGuiWindow* window, bool horizontal)
44744474
: ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + border_size, window_rect.Max.x - border_size, window_rect.Max.y - other_scrollbar_size_w - border_size);
44754475
if (!horizontal)
44764476
bb.Min.y += window->TitleBarHeight() + ((window->Flags & ImGuiWindowFlags_MenuBar) ? window->MenuBarHeight() : 0.0f);
4477+
if (bb.GetWidth() <= 0.0f || bb.GetHeight() <= 0.0f)
4478+
return;
44774479

44784480
float window_rounding = (window->Flags & ImGuiWindowFlags_ChildWindow) ? style.ChildWindowRounding : style.WindowRounding;
44794481
int window_rounding_corners;

0 commit comments

Comments
 (0)