Permalink
Browse files

grid span support

  • Loading branch information...
1 parent 9271e07 commit 7f7e5733b6319218fc2fbe1e236b40408bf87259 @cail committed Mar 16, 2013
Showing with 7 additions and 6 deletions.
  1. +7 −6 Fleux/UIElements/Grid/Grid.cs
@@ -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;

0 comments on commit 7f7e573

Please sign in to comment.