Merge pull request #7405 from Rydra/upstream/int2immutable
Made int2 class immutable
This commit is contained in:
@@ -47,7 +47,7 @@ namespace OpenRA.Widgets
|
||||
}
|
||||
|
||||
var text = WidgetUtils.WrapText(line.Text, chatLogArea.Width - inset - 6, font);
|
||||
chatpos.Y -= Math.Max(15, font.Measure(text).Y) + 5;
|
||||
chatpos = chatpos.WithY(chatpos.Y - (Math.Max(15, font.Measure(text).Y) + 5));
|
||||
|
||||
if (chatpos.Y < pos.Y)
|
||||
break;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Widgets
|
||||
if (tooltip != null)
|
||||
{
|
||||
if (pos.X + tooltip.Bounds.Right > Game.Renderer.Resolution.Width)
|
||||
pos.X = Game.Renderer.Resolution.Width - tooltip.Bounds.Right;
|
||||
pos = pos.WithX(Game.Renderer.Resolution.Width - tooltip.Bounds.Right);
|
||||
}
|
||||
|
||||
return pos;
|
||||
|
||||
Reference in New Issue
Block a user