mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-22 20:02:48 +00:00
Fixed two crashes that happened when trying to reset the grid transform, or toggling the grid visibility while no map was opened
This commit is contained in:
parent
4f526dc57f
commit
59de9762ad
1 changed files with 6 additions and 0 deletions
|
@ -3052,6 +3052,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
[BeginAction("togglegrid")]
|
||||
protected void ToggleGrid()
|
||||
{
|
||||
if (General.Map == null)
|
||||
return;
|
||||
|
||||
General.Settings.RenderGrid = !General.Settings.RenderGrid;
|
||||
itemtogglegrid.Checked = General.Settings.RenderGrid;
|
||||
buttontogglegrid.Checked = General.Settings.RenderGrid;
|
||||
|
@ -3103,6 +3106,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
[BeginAction("resetgrid")]
|
||||
protected void ResetGrid()
|
||||
{
|
||||
if (General.Map == null)
|
||||
return;
|
||||
|
||||
General.Map.Grid.SetGridRotation(0.0f);
|
||||
General.Map.Grid.SetGridOrigin(0, 0);
|
||||
General.Map.CRenderer2D.GridVisibilityChanged();
|
||||
|
|
Loading…
Reference in a new issue