Made int2 struct immutable

This commit is contained in:
David Jiménez
2015-01-30 22:30:27 +01:00
committed by Rydra
parent 8c4ea20636
commit f15f1e41e8
11 changed files with 34 additions and 26 deletions

View File

@@ -30,14 +30,13 @@ namespace OpenRA.Widgets
if (pos.X + widget.ItemSpacing + w.Bounds.Width > widget.Bounds.Width - widget.ScrollbarWidth)
{
/* start a new row */
pos.X = widget.ItemSpacing;
pos.Y = widget.ContentHeight;
pos = new int2(widget.ItemSpacing, widget.ContentHeight);
}
w.Bounds.X += pos.X;
w.Bounds.Y += pos.Y;
pos.X += w.Bounds.Width + widget.ItemSpacing;
pos = pos.WithX(pos.X + w.Bounds.Width + widget.ItemSpacing);
widget.ContentHeight = Math.Max(widget.ContentHeight, pos.Y + widget.ItemSpacing + w.Bounds.Height);
}