diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 21a8c101..2440e0c7 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -773,6 +773,10 @@ struct Imgui if (barHeight < 1.0f) { + // Handle m_scrollVal properly on variable scrollable area height. + const int32_t diff = height - sh; + *m_scrollVal = (*m_scrollVal < diff) ? diff : *m_scrollVal; // m_scrollVal = max(m_scrollVal, diff). + float barY = bx::fsaturate( (float)(yy - stop) / (float)sh); // Handle scroll bar logic.