Imgui scroll fix for variable scrollable area height.

This commit is contained in:
Dario Manesku 2014-08-12 11:41:57 +01:00
parent 9715d6fab4
commit d64a62866a

View file

@ -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.