Smibu / elmanager

A tool for managing Elasto Mania replays and levels
GNU General Public License v3.0
6 stars 4 forks source link

Using transform tool without selection causes error #132

Closed alistaircarscadden closed 4 years ago

alistaircarscadden commented 4 years ago

When using the transform tool (space) without a selection you will get an DivideByZero error you cannot continue from, only quit.

Only occurs when no previous selection was made. So, if you select a polygon, and unselect it, then use spacebar, no error happens.

alistaircarscadden commented 4 years ago

Using the debug tool it seems that in TransformTool.cs on line 169

public void MouseDown(MouseEventArgs mouseData)
        ...
                for (i = 0; i < 4; i++)
                {
                    if ((_transformRectangle[i] - CurrentPos).Length <
                        Global.AppSettings.LevelEditor.CaptureRadius * Renderer.ZoomLevel)
                    {

_transformRectangle is null

Smibu commented 4 years ago

Fixed in https://github.com/Smibu/elmanager/pull/133.