Fix CandidateMouseoverCells not accounting for tile scale
This commit is contained in:
committed by
Matthias Mailänder
parent
3e6123f6f6
commit
3824a591d5
@@ -282,11 +282,12 @@ namespace OpenRA.Graphics
|
|||||||
IEnumerable<MPos> CandidateMouseoverCells(int2 world)
|
IEnumerable<MPos> CandidateMouseoverCells(int2 world)
|
||||||
{
|
{
|
||||||
var map = worldRenderer.World.Map;
|
var map = worldRenderer.World.Map;
|
||||||
|
var tileScale = map.Grid.TileScale / 2;
|
||||||
var minPos = worldRenderer.ProjectedPosition(world);
|
var minPos = worldRenderer.ProjectedPosition(world);
|
||||||
|
|
||||||
// Find all the cells that could potentially have been clicked
|
// Find all the cells that could potentially have been clicked.
|
||||||
var a = map.CellContaining(minPos - new WVec(1024, 0, 0)).ToMPos(map.Grid.Type);
|
var a = map.CellContaining(minPos - new WVec(tileScale, 0, 0)).ToMPos(map.Grid.Type);
|
||||||
var b = map.CellContaining(minPos + new WVec(512, 512 * map.Grid.MaximumTerrainHeight, 0)).ToMPos(map.Grid.Type);
|
var b = map.CellContaining(minPos + new WVec(tileScale, tileScale * map.Grid.MaximumTerrainHeight, 0)).ToMPos(map.Grid.Type);
|
||||||
|
|
||||||
for (var v = b.V; v >= a.V; v--)
|
for (var v = b.V; v >= a.V; v--)
|
||||||
for (var u = b.U; u >= a.U; u--)
|
for (var u = b.U; u >= a.U; u--)
|
||||||
|
|||||||
Reference in New Issue
Block a user