Fix radar cursor fake mouse event location.

This commit is contained in:
Paul Chote
2013-09-24 18:36:08 +12:00
parent b100b4131c
commit 7320493a21

View File

@@ -82,16 +82,17 @@ namespace OpenRA.Mods.RA.Widgets
if (world == null || !hasRadar) if (world == null || !hasRadar)
return null; return null;
var loc = MinimapPixelToCell(pos); var cell = MinimapPixelToCell(pos);
var location = Game.viewport.WorldToViewPx(worldRenderer.ScreenPxPosition(cell.CenterPosition));
var mi = new MouseInput var mi = new MouseInput
{ {
Location = loc.ToInt2(), Location = location,
Button = MouseButton.Right, Button = MouseButton.Right,
Modifiers = Game.GetModifierKeys() Modifiers = Game.GetModifierKeys()
}; };
var cursor = world.OrderGenerator.GetCursor(world, loc, mi); var cursor = world.OrderGenerator.GetCursor(world, cell, mi);
if (cursor == null) if (cursor == null)
return "default"; return "default";