Fix radar viewport rectangle

This commit is contained in:
Paul Chote
2011-07-22 21:42:21 +12:00
parent 0b0e3d5f14
commit 0bfc9a957f
3 changed files with 20 additions and 4 deletions

View File

@@ -148,8 +148,10 @@ namespace OpenRA.Mods.RA.Widgets
// Draw viewport rect
if (radarAnimationFrame == radarSlideAnimationLength + radarActivateAnimationLength)
{
var tl = CellToMinimapPixel(new int2((int)(Game.viewport.Location.X/Game.CellSize), (int)(Game.viewport.Location.Y/Game.CellSize)));
var br = CellToMinimapPixel(new int2((int)((Game.viewport.Location.X + Game.viewport.Width)/Game.CellSize), (int)((Game.viewport.Location.Y + Game.viewport.Height)/Game.CellSize)));
var wr = Game.viewport.WorldRect;
var wro = new int2(wr.X, wr.Y);
var tl = CellToMinimapPixel(wro);
var br = CellToMinimapPixel(wro + new int2(wr.Width, wr.Height));
Game.Renderer.EnableScissor((int)mapRect.Left, (int)mapRect.Top, (int)mapRect.Width, (int)mapRect.Height);
Game.Renderer.LineRenderer.DrawRect(tl, br, Color.White);