コード例 #1
0
ファイル: ScrollContainer.cs プロジェクト: emipa606/PhiClient
        // Token: 0x0600007D RID: 125 RVA: 0x00004244 File Offset: 0x00002444
        public override void Draw(Rect inRect)
        {
            var rect  = inRect.LeftPartPixels(inRect.width - 16f);
            var width = rect.width;
            var num   = child.CalcHeight(rect.width);

            if (num == -1f)
            {
                num = rect.height;
            }

            var rect2 = new Rect(0f, 0f, width, num);

            Widgets.BeginScrollView(inRect, ref scrollPosition, rect2);
            onScroll(scrollPosition);
            child.Draw(rect2);
            Widgets.EndScrollView();
        }
コード例 #2
0
        public override void Draw(Rect inRect)
        {
            Rect viewRect = inRect.LeftPartPixels(inRect.width - SCROLL_BAR_SIZE);

            // We calculate the overflowed size the children will take
            // Only supports y-overflow at the moment
            float widthChild  = viewRect.width;
            float heightChild = child.CalcHeight(viewRect.width);

            if (heightChild == -1)
            {
                // If the child is height-fluid, we attribute the available space
                heightChild = viewRect.height;
            }
            Rect childRect = new Rect(0, 0, widthChild, heightChild);

            Widgets.BeginScrollView(inRect, ref scrollPosition, childRect);
            onScroll(scrollPosition);

            child.Draw(childRect);

            Widgets.EndScrollView();
        }