Skip to content

可否给Scrollbar.size加个限制? #215

@ZeroUltra

Description

@ZeroUltra

当数据比较多的时候Scrollbar的handle会变得很小很小,所以在想要不要给Scrollbar.size加个功能限制下?
类似下面,LoopScrollRectBase

             if (m_ContentBounds.size.y > 0 && totalCount > 0)
             {
                 float totalSize, _;
                 GetVerticalOffsetAndSize(out totalSize, out _);
                 //m_VerticalScrollbar.size = Mathf.Clamp01((m_ViewBounds.size.y - Mathf.Abs(offset.y)) / totalSize);
                 float size = Mathf.Clamp01((m_ViewBounds.size.y - Mathf.Abs(offset.y)) / totalSize);
                 if (size < 0.08f)
                     size = 0.08f;
                 m_VerticalScrollbar.size = size;
             }
             //==========LoopScrollRect==========
             else
                 m_VerticalScrollbar.size = 1;

不知道我这个想法(限制Scrollbar.size)是否对的,还是就我有这个需求?


最后想说下,作者是真用心哈哈,维护的很勤,👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions