Skip to content

Commit

Permalink
grid span support
Browse files Browse the repository at this point in the history
  • Loading branch information
cail committed Mar 16, 2013
1 parent 9271e07 commit 7f7e573
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Fleux/UIElements/Grid/Grid.cs
Expand Up @@ -63,12 +63,13 @@ public void RelocateCells()
int y = this.Location.Y.ToPixels();
for (var row = 0; row < this.rows.Count(); row++)
{
this.cells.Where(c => (c.Column == column) && (c.Row == row)).ToList()
.ForEach(c =>
{
c.Content.Location = new Point(x, y);
c.Content.Size = new Size(this.Columns[column].Value, this.Rows[row].Value);
});
this.cells.Where(c => (c.Column == column) && (c.Row == row)).ToList().ForEach(c =>
{
c.Content.Location = new Point(x, y);
var cw = this.Columns.Skip(column).Take(c.ColumnSpan).Sum( (it) => it.Value );
var ch = this.Rows.Skip(row).Take(c.RowSpan).Sum( (it) => it.Value );
c.Content.Size = new Size(cw, ch);
});
y += this.Rows[row].Value;
}
x += this.Columns[column].Value;
Expand Down

0 comments on commit 7f7e573

Please sign in to comment.