From de0a31b90567fcd0e91e2d4306e1cafad8525b94 Mon Sep 17 00:00:00 2001 From: chrisf Date: Thu, 12 Jul 2007 13:24:22 +0000 Subject: [PATCH] git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1177 993157c7-ee19-0410-b2c4-bb4e9862e678 --- OpenRa.Game/MainWindow.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRa.Game/MainWindow.cs b/OpenRa.Game/MainWindow.cs index d0c7627281..e2e991a18e 100644 --- a/OpenRa.Game/MainWindow.cs +++ b/OpenRa.Game/MainWindow.cs @@ -105,7 +105,7 @@ namespace OpenRa.Game public MainWindow() { FormBorderStyle = FormBorderStyle.None; - renderer = new Renderer(this, new Size(1280, 800), false); + renderer = new Renderer(this, Screen.PrimaryScreen.Bounds.Size, false); Visible = true; IniFile mapFile = new IniFile(File.OpenRead("../../../" + mapName)); @@ -178,8 +178,10 @@ namespace OpenRa.Game int firstRow = (int)(scrollPos.Y / 24.0f); int lastRow = firstRow + visibleRows; + if (lastRow < 0 || firstRow > map.Height) + return; + if (firstRow < 0) firstRow = 0; - if (lastRow < 0) lastRow = 0; if (lastRow > map.Height) lastRow = map.Height; renderer.DrawWithShader(ShaderQuality.Low, delegate