diff --git a/UI/ProfilerDraw.cpp b/UI/ProfilerDraw.cpp index f90427df44..a4ffb8bbb3 100644 --- a/UI/ProfilerDraw.cpp +++ b/UI/ProfilerDraw.cpp @@ -94,6 +94,10 @@ void DrawProfile(UIContext &ui) { } legendWidth += 20.0f; + if (legendHeight > ui.GetBounds().h) { + legendHeight = ui.GetBounds().h; + } + float legendStartY = legendHeight > ui.GetBounds().centerY() ? ui.GetBounds().y2() - legendHeight : ui.GetBounds().centerY(); float legendStartX = ui.GetBounds().x2() - std::min(legendWidth, 200.0f);