mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixed imgui scroll value handling on window resize.
This commit is contained in:
parent
7225bba1a1
commit
f3fb007471
1 changed files with 11 additions and 4 deletions
|
@ -771,12 +771,19 @@ struct Imgui
|
||||||
|
|
||||||
float barHeight = (float)height / (float)sh;
|
float barHeight = (float)height / (float)sh;
|
||||||
|
|
||||||
|
// Handle m_scrollVal properly on variable scrollable area height.
|
||||||
|
const int32_t diff = height - sh;
|
||||||
|
if (diff < 0)
|
||||||
|
{
|
||||||
|
*m_scrollVal = (*m_scrollVal > diff) ? *m_scrollVal : diff; // m_scrollVal = max(diff, m_scrollVal).
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*m_scrollVal = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (barHeight < 1.0f)
|
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);
|
float barY = bx::fsaturate( (float)(yy - stop) / (float)sh);
|
||||||
|
|
||||||
// Handle scroll bar logic.
|
// Handle scroll bar logic.
|
||||||
|
|
Loading…
Reference in a new issue