Add Visject surface boxes and connections drawing customization via style

This commit is contained in:
Wojtek Figat
2023-08-13 19:14:23 +02:00
parent e27f1a8a41
commit ae4bce7a68
8 changed files with 78 additions and 62 deletions

View File

@@ -165,25 +165,22 @@ namespace FlaxEditor.Surface
{
if (Surface == null)
return;
Size = CalculateNodeSize(width, height);
// Update boxes on width change
//if (!Mathf.NearEqual(prevSize.X, Size.X))
for (int i = 0; i < Elements.Count; i++)
{
for (int i = 0; i < Elements.Count; i++)
if (Elements[i] is OutputBox box)
{
if (Elements[i] is OutputBox box)
{
box.Location = box.Archetype.Position + new Float2(width, 0);
}
box.Location = box.Archetype.Position + new Float2(width, 0);
}
}
Size = CalculateNodeSize(width, height);
}
/// <summary>
/// Automatically resizes the node to match the title size and all the elements for best fit of the node dimensions.
/// </summary>
public void ResizeAuto()
public virtual void ResizeAuto()
{
if (Surface == null)
return;