Add support for diamond cell grids.

This commit is contained in:
Paul Chote
2014-06-30 11:25:39 +12:00
parent af0e948a67
commit a30c8b53a7
11 changed files with 191 additions and 82 deletions

View File

@@ -129,9 +129,10 @@ namespace OpenRA.Widgets
tooltipContainer.Value.RemoveTooltip();
}
public int2 ConvertToPreview(CPos point)
public int2 ConvertToPreview(CPos cell)
{
var preview = Preview();
var point = Map.CellToMap(preview.Map.TileShape, cell);
var dx = (int)(previewScale * (point.X - preview.Bounds.Left));
var dy = (int)(previewScale * (point.Y - preview.Bounds.Top));
return new int2(mapRect.X + dx, mapRect.Y + dy);