1
0
mirror of synced 2025-02-21 13:00:52 +01:00

Fix crash from model edits while viewport is disabled

This commit is contained in:
KillzXGaming 2019-04-25 16:55:30 -04:00
parent 705837ab0c
commit 91694c2fcb
3 changed files with 9 additions and 8 deletions

Binary file not shown.

View File

@ -56,7 +56,7 @@ namespace FirstPlugin.Forms
return null;
var editor = LibraryGUI.Instance.GetObjectEditor();
return editor.GetViewport();
return editor.GetViewport();
}
set
{
@ -157,11 +157,11 @@ namespace FirstPlugin.Forms
public void AddDrawable(AbstractGlDrawable draw)
{
if (!Runtime.UseViewport)
return;
Drawables.Add(draw);
if (!Runtime.UseViewport || !Runtime.DisplayViewport)
return;
if (!viewport.scene.staticObjects.Contains(draw) &&
!viewport.scene.objects.Contains(draw))
{
@ -171,10 +171,11 @@ namespace FirstPlugin.Forms
public void RemoveDrawable(AbstractGlDrawable draw)
{
if (!Runtime.UseViewport)
Drawables.Remove(draw);
if (!Runtime.UseViewport || !Runtime.DisplayViewport)
return;
Drawables.Remove(draw);
viewport.RemoveDrawable(draw);
}