private void _ResizeDivs() { // Resize widths int fixedWidth = Divs.Where(x => !x.AutoWidth).Sum(x => x.Width); int remainderWidth = Width - fixedWidth; List <Div> autoDivs = Divs.Where(x => x.AutoWidth).ToList(); if (autoDivs.Count > 0) { int newWidth = remainderWidth / autoDivs.Count; autoDivs.ForEach(x => x.Width = newWidth); } // Resize heights Divs.ForEach(x => { if (x.AutoHeight) { x.Height = Height; } }); }
public override void Draw(SpriteBatch spriteBatch, TextureFrameStore textureFrames) { this.DrawBorder(spriteBatch, textureFrames, BorderWidth, BorderColor); Divs.ForEach(x => x.Draw(spriteBatch, textureFrames)); }