fix some dumb (nonfatal) crashes in the editor with nothing loaded
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user