RelativeToRealSizes() public method

public RelativeToRealSizes ( int totalSpace ) : void
totalSpace int
return void
        internal override void Reflow()
        {
            SetupSplitter();

            for (int k = 0; k < children.Length - 1; k++)
            {
                splitState.DoSplitter(k, k + 1, 0);
            }
            splitState.RelativeToRealSizes(vertical ? (int)position.height : (int)position.width);
            SetupRectsFromSplitter();
        }
Beispiel #2
0
        internal override void Reflow()
        {
            SetupSplitter();

            for (int k = 0; k < children.Length - 1; k++)
            {
                splitState.DoSplitter(k, k + 1, 0);
            }
            splitState.RelativeToRealSizes(vertical ? GUIUtility.RoundToPixelGrid(position.height) : GUIUtility.RoundToPixelGrid(position.width));
            SetupRectsFromSplitter();
        }
Beispiel #3
0
            public override void SetHorizontal(float x, float width)
            {
                if (!isVertical)
                {
                    int k;

                    state.xOffset = x;

                    float alignedWidth = GUIUtility.RoundToPixelGrid(width);
                    if (alignedWidth != state.lastTotalSize)
                    {
                        state.RelativeToRealSizes(alignedWidth);
                        state.lastTotalSize = alignedWidth;

                        // maintain constraints while resizing
                        for (k = 0; k < state.realSizes.Length - 1; k++)
                        {
                            state.DoSplitter(k, k + 1, 0);
                        }
                    }

                    k = 0;

                    foreach (GUILayoutEntry i in entries)
                    {
                        float thisSize = state.realSizes[k];

                        i.SetHorizontal(GUIUtility.RoundToPixelGrid(x), GUIUtility.RoundToPixelGrid(thisSize));
                        x += thisSize + spacing;
                        k++;
                    }
                }
                else
                {
                    base.SetHorizontal(x, width);
                }
            }