fix some dumb (nonfatal) crashes in the editor with nothing loaded

This commit is contained in:
Chris Forbes
2010-10-11 18:21:41 +13:00
parent 0df9815d2c
commit a2205e9031
3 changed files with 13 additions and 7 deletions

View File

@@ -87,6 +87,8 @@ namespace OpenRA.Editor
{
base.OnMouseWheel(e);
if (Map == null) return;
Zoom *= e.Delta > 0 ? 4.0f / 3.0f : .75f;
Invalidate();
@@ -114,6 +116,8 @@ namespace OpenRA.Editor
{
base.OnMouseMove(e);
if (Map == null) return;
var oldMousePos = MousePos;
MousePos = new int2(e.Location);
@@ -332,6 +336,8 @@ namespace OpenRA.Editor
{
base.OnMouseDown(e);
if (Map == null) return;
if (!IsPanning)
{
if (e.Button == MouseButtons.Right) Erase();