BlisterUI.Widgets.BaseWidget.Recompute C# (CSharp) Method

Recompute() protected method

protected Recompute ( ) : void
return void
        protected virtual void Recompute()
        {
            if(parent != null) {
                // Get Anchor Via The Parent
                anchor.X = parent.X + ((offAlign.X * parent.Width) / 2) + offset.X;
                anchor.Y = parent.Y + ((offAlign.Y * parent.Height) / 2) + offset.Y;
                LayerDepth = parent.LayerDepth + LayerOffset;
            }

            // Use Alignment For Computation
            X = anchor.X - ((align.X * Width) / 2);
            Y = anchor.Y - ((align.Y * Height) / 2);

            if(OnRecompute != null)
                OnRecompute(this);
        }