Introduce a new type for representing map coordinates.
To resolve the ambiguity introduced when the introduction of isometric maps meant that cell and map coordinates were no longer equivalent, a new type has been introduced so they can each be represented separately.
This commit is contained in:
@@ -133,9 +133,9 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
var preview = Preview();
|
||||
var tileShape = Game.ModData.Manifest.TileShape;
|
||||
var point = Map.CellToMap(tileShape, cell);
|
||||
var dx = (int)(previewScale * (point.X - preview.Bounds.Left));
|
||||
var dy = (int)(previewScale * (point.Y - preview.Bounds.Top));
|
||||
var point = cell.ToMPos(tileShape);
|
||||
var dx = (int)(previewScale * (point.U - preview.Bounds.Left));
|
||||
var dy = (int)(previewScale * (point.V - preview.Bounds.Top));
|
||||
return new int2(mapRect.X + dx, mapRect.Y + dy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user