Пример #1
0
        protected void FixLayout()
        {
            float width = this.Bounds.Width;
            float num   = Math.Max(_collection.GetMinLayoutSize().Width, _minWidth);
            float num2  = 0f;

            if (num > this.Bounds.Width)
            {
                num2        = num - this.Bounds.Width;
                this.Bounds = (new RectangleF(this.Bounds.X - num2 / 2f, this.Bounds.Y, num, this.Bounds.Height));
            }
            foreach (IGH_Param item in base.Owner.Params.Output)
            {
                PointF     pivot  = item.Attributes.Pivot;
                RectangleF bounds = item.Attributes.Bounds;
                item.Attributes.Pivot  = (new PointF(pivot.X, pivot.Y));
                item.Attributes.Bounds = (new RectangleF(bounds.Location.X, bounds.Location.Y, bounds.Width + num2 / 2f, bounds.Height));
            }
            foreach (IGH_Param item2 in base.Owner.Params.Input)
            {
                PointF     pivot2  = item2.Attributes.Pivot;
                RectangleF bounds2 = item2.Attributes.Bounds;
                item2.Attributes.Pivot  = (new PointF(pivot2.X - num2 / 2f, pivot2.Y));
                item2.Attributes.Bounds = (new RectangleF(bounds2.Location.X - num2 / 2f, bounds2.Location.Y, bounds2.Width + num2 / 2f, bounds2.Height));
            }
        }
Пример #2
0
        protected void LayoutBaseComponent()
        {
            GH_SwitcherComponent gH_SwitcherComponent = (GH_SwitcherComponent)base.Owner;

            this.Pivot         = ((PointF)GH_Convert.ToPoint(this.Pivot));
            base.m_innerBounds = LayoutComponentBox2(base.Owner);
            int   num        = ComputeW_ico(base.Owner);
            float width      = composedCollection.GetMinLayoutSize().Width;
            float num2       = Math.Max(MinWidth, width);
            int   add_offset = 0;

            if (num2 > (float)num)
            {
                add_offset = (int)((double)(num2 - (float)num) / 2.0);
            }
            LayoutInputParams2(base.Owner, base.m_innerBounds, add_offset);
            LayoutOutputParams2(base.Owner, base.m_innerBounds, add_offset);
            this.Bounds = (LayoutBounds2(base.Owner, base.m_innerBounds));
        }