diff --git a/src/GUIStuff/Elements/TreeListing.cpp b/src/GUIStuff/Elements/TreeListing.cpp index fa31a46..1168a64 100644 --- a/src/GUIStuff/Elements/TreeListing.cpp +++ b/src/GUIStuff/Elements/TreeListing.cpp @@ -45,7 +45,7 @@ void TreeListing::update(UpdateInputData& io, GUIManager& gui, NetworkingObjects } }) {} } - }); + }, false); } Clay_ElementData scrollAreaBB = Clay_GetElementData(localID); if(scrollAreaBB.found) { diff --git a/src/GUIStuff/GUIManager.cpp b/src/GUIStuff/GUIManager.cpp index cfac90b..54c875b 100644 --- a/src/GUIStuff/GUIManager.cpp +++ b/src/GUIStuff/GUIManager.cpp @@ -669,7 +669,7 @@ void GUIManager::dropdown_select(const std::string& id, size_t* val, const std:: pop_id(); } -void GUIManager::scroll_bar_area(const std::string& id, bool clipHorizontal, const std::function& elemUpdate) { +void GUIManager::scroll_bar_area(const std::string& id, bool clipHorizontal, const std::function& elemUpdate, bool maxScrollBugWorkaround) { push_id(id); CLAY_AUTO_ID({ .layout = { @@ -717,7 +717,7 @@ void GUIManager::scroll_bar_area(const std::string& id, bool clipHorizontal, con float sAreaDim = scrollData.scrollContainerDimensions.height; float contDim = scrollData.contentDimensions.height; float scrollerSize = (sAreaDim / contDim) * sAreaDim; - float scrollPosMax = (contDim - sAreaDim);// + 3.0f; NOTE: Adding + 3.0f to prevent bug with scroller that pushes everything under it when its at the bottom of the scroll area (I think the bug that caused this is fixed now) + float scrollPosMax = (contDim - sAreaDim) + (maxScrollBugWorkaround ? 3.0f : 0.0f); //NOTE: Adding + 3.0f to prevent bug with scroller that pushes everything under it when its at the bottom of the scroll area. Only happens with some scroll areas float scrollerPos = std::fabs(scrollData.scrollPosition->y / scrollPosMax); float areaAboveScrollerSize = scrollerPos * (sAreaDim - scrollerSize); diff --git a/src/GUIStuff/GUIManager.hpp b/src/GUIStuff/GUIManager.hpp index fa6311b..3eb4bb8 100644 --- a/src/GUIStuff/GUIManager.hpp +++ b/src/GUIStuff/GUIManager.hpp @@ -80,7 +80,7 @@ class GUIManager { void push_id(const std::string& id); void pop_id(); - void scroll_bar_area(const std::string& id, bool clipHorizontal, const std::function& elemUpdate); + void scroll_bar_area(const std::string& id, bool clipHorizontal, const std::function& elemUpdate, bool maxScrollBugWorkaround = true); void scroll_bar_many_entries_area(const std::string& id, float entryHeight, size_t entryCount, bool clipHorizontal, const std::function& entryUpdate, const std::function& elemUpdate = nullptr); bool input_color_component_255(const std::string& id, float* val, const std::function& elemUpdate = nullptr);