Reapplied scroll workaround
This commit is contained in:
parent
850882c8ed
commit
3953fd16f3
3 changed files with 4 additions and 4 deletions
|
|
@ -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<void(float, float, float&)>& elemUpdate) {
|
||||
void GUIManager::scroll_bar_area(const std::string& id, bool clipHorizontal, const std::function<void(float, float, float&)>& 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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue