Merge pull request #7405 from Rydra/upstream/int2immutable
Made int2 class immutable
This commit is contained in:
@@ -45,9 +45,18 @@ namespace OpenRA.Graphics
|
||||
.ToArray();
|
||||
|
||||
if (d.ContainsKey("X"))
|
||||
Exts.TryParseIntegerInvariant(d["X"].Value, out Hotspot.X);
|
||||
{
|
||||
int x;
|
||||
Exts.TryParseIntegerInvariant(d["X"].Value, out x);
|
||||
Hotspot = Hotspot.WithX(x);
|
||||
}
|
||||
|
||||
if (d.ContainsKey("Y"))
|
||||
Exts.TryParseIntegerInvariant(d["Y"].Value, out Hotspot.Y);
|
||||
{
|
||||
int y;
|
||||
Exts.TryParseIntegerInvariant(d["Y"].Value, out y);
|
||||
Hotspot = Hotspot.WithY(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
dataX = -hotspot.X;
|
||||
dataWidth += dataX;
|
||||
hotspot.X = 0;
|
||||
hotspot = hotspot.WithX(0);
|
||||
}
|
||||
else if (hotspot.X >= frameWidth)
|
||||
dataWidth = hotspot.X + 1;
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
dataY = -hotspot.Y;
|
||||
dataHeight += dataY;
|
||||
hotspot.Y = 0;
|
||||
hotspot = hotspot.WithY(0);
|
||||
}
|
||||
else if (hotspot.Y >= frameHeight)
|
||||
dataHeight = hotspot.Y + 1;
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
Sprite = s,
|
||||
Advance = (int)face.Glyph.Metrics.HorizontalAdvance / 64f,
|
||||
Offset = { X = face.Glyph.BitmapLeft, Y = -face.Glyph.BitmapTop }
|
||||
Offset = new int2(face.Glyph.BitmapLeft, -face.Glyph.BitmapTop)
|
||||
};
|
||||
|
||||
// A new bitmap is generated each time this property is accessed, so we do need to dispose it.
|
||||
|
||||
Reference in New Issue
Block a user