mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Fixed holdng scrollbar creating a small feedback loop with calculation of contents size
This commit is contained in:
parent
2bce6bf085
commit
c116dad304
@ -2781,7 +2781,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
|
||||
{
|
||||
g.HoveredId = scrollbar_id;
|
||||
const float pos_y_norm = ImSaturate((g.IO.MousePos.y - (scrollbar_bb.Min.y + grab_size_y*0.5f)) / (scrollbar_bb.GetHeight() - grab_size_y)) * (1.0f - grab_size_y_norm);
|
||||
window->ScrollY = pos_y_norm * window->SizeContentsFit.y;
|
||||
window->ScrollY = (float)(int)(pos_y_norm * window->SizeContentsFit.y);
|
||||
window->NextScrollY = window->ScrollY;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user