Scale is now set via a field on Render* and interacts properly with chronoshift and building previews.

This commit is contained in:
Paul Chote
2010-11-27 13:30:08 +13:00
parent 840ade5b78
commit 00a0aac7a3
10 changed files with 25 additions and 76 deletions

View File

@@ -91,17 +91,10 @@ namespace OpenRA
public RectangleF GetBounds(bool useAltitude)
{
var si = Info.Traits.GetOrDefault<SelectableInfo>();
var size = Size.Value;
/* apply scaling */
var scale = this.TraitOrDefault<Scale>();
if (scale != null && scale.Info.Value != 1)
size = size*scale.Info.Value;
var loc = CenterLocation - 0.5f * size;
var size = Size.Value;
var loc = CenterLocation - 0.5f * size;
var si = Info.Traits.GetOrDefault<SelectableInfo>();
if (si != null && si.Bounds != null && si.Bounds.Length > 2)
loc += new float2(si.Bounds[2], si.Bounds[3]);