Fix placement and usage of the new instance creation button in GenericEditor
This commit is contained in:
@@ -434,16 +434,18 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
{
|
{
|
||||||
Text = "+",
|
Text = "+",
|
||||||
TooltipText = "Create a new instance of the object",
|
TooltipText = "Create a new instance of the object",
|
||||||
Height = ButtonSize,
|
Size = new Vector2(ButtonSize, ButtonSize),
|
||||||
Width = ButtonSize,
|
|
||||||
X = layout.ContainerControl.Width - ButtonSize - 4,
|
|
||||||
AnchorPreset = AnchorPresets.MiddleRight,
|
AnchorPreset = AnchorPresets.MiddleRight,
|
||||||
Parent = layout.ContainerControl
|
Parent = layout.ContainerControl,
|
||||||
|
Location = new Vector2(layout.ContainerControl.Width - ButtonSize - 4, (layout.ContainerControl.Height - ButtonSize) * 0.5f),
|
||||||
};
|
};
|
||||||
button.Clicked += () =>
|
button.Clicked += () =>
|
||||||
{
|
{
|
||||||
var newType = Values.Type;
|
var newType = Values.Type;
|
||||||
SetValue(newType.CreateInstance());
|
SetValue(newType.CreateInstance());
|
||||||
|
if (ParentEditor != null)
|
||||||
|
ParentEditor.RebuildLayoutOnRefresh();
|
||||||
|
else
|
||||||
RebuildLayoutOnRefresh();
|
RebuildLayoutOnRefresh();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user