1
0
mirror of synced 2024-12-03 19:47:29 +01:00

Fix multiple layout tabs not finding the viewport as active content

This commit is contained in:
KillzXGaming 2019-09-28 19:13:32 -04:00
parent 0808bd0347
commit 5655b8c3f4
3 changed files with 23 additions and 7 deletions

View File

@ -16,6 +16,11 @@ namespace LayoutBXLYT
public List<string> Textures = new List<string>(); public List<string> Textures = new List<string>();
public void UpdateLayout(BxlytHeader heeader)
{
parentLayout = heeader;
}
public override void Reset() public override void Reset()
{ {
if (parentLayout == null) return; if (parentLayout == null) return;

View File

@ -816,6 +816,8 @@ namespace LayoutBXLYT
{ {
if (animation == null) if (animation == null)
animation = new LytAnimation(this, parentLayout); animation = new LytAnimation(this, parentLayout);
else
animation.UpdateLayout(parentLayout);
return animation; return animation;
} }
} }

View File

@ -455,14 +455,23 @@ namespace LayoutBXLYT
private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e) private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
{ {
var dockContent = dockPanel1.ActiveDocument as LayoutViewer; var dockContent = dockPanel1.ActiveDocument as DockContent;
if (dockContent != null) if (dockContent == null) return;
{
var file = (dockContent).LayoutFile;
ReloadEditors(file);
ActiveViewport = dockContent;
dockContent.UpdateViewport(); LayoutViewer viewer = null;
foreach (var control in dockContent.Controls)
if (control is LayoutViewer)
viewer = control as LayoutViewer;
if (viewer != null)
{
var file = viewer.LayoutFile;
ActiveLayout = file;
ReloadEditors(file);
ActiveViewport = viewer;
viewer.UpdateViewport();
Console.WriteLine("changed " + ActiveLayout.FileName);
} }
} }