Scrolling: Fixed edge snapping being applied prior to knowing ContentSize. (#3452)

Fix 473a01adb.
This commit is contained in:
ocornut
2020-09-03 17:38:51 +02:00
parent 8db94cd992
commit 70289ab42c
2 changed files with 30 additions and 25 deletions

View File

@ -1585,6 +1585,7 @@ struct IMGUI_API ImGuiWindow
ImVec2 ScrollMax;
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
ImVec2 ScrollTargetEdgeSnapDist; // 0.0f = no snapping, >0.0f snapping threshold
ImVec2 ScrollbarSizes; // Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar.
bool ScrollbarX, ScrollbarY; // Are scrollbars visible?
bool Active; // Set to true on Begin(), unless Collapsed