Add improved size of Multi Blend nodes

#1980
This commit is contained in:
Wojtek Figat
2024-04-17 23:04:09 +02:00
parent d379b4c046
commit e31ce787aa
2 changed files with 16 additions and 15 deletions

View File

@@ -795,11 +795,12 @@ namespace FlaxEditor.Surface.Archetypes
}; };
_animationY.ValueChanged += OnAnimationYChanged; _animationY.ValueChanged += OnAnimationYChanged;
var size = Width - FlaxEditor.Surface.Constants.NodeMarginX * 2.0f;
_editor = new Editor(this, _editor = new Editor(this,
FlaxEditor.Surface.Constants.NodeMarginX, FlaxEditor.Surface.Constants.NodeMarginX,
_animationY.Bottom + 4.0f, _animationY.Bottom + 4.0f,
Width - FlaxEditor.Surface.Constants.NodeMarginX * 2.0f, size,
120.0f); size);
_editor.Parent = this; _editor.Parent = this;
} }

View File

@@ -658,10 +658,10 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Input(2, "Start Position", true, typeof(float), 3, 3), NodeElementArchetype.Factory.Input(2, "Start Position", true, typeof(float), 3, 3),
// Axis X // Axis X
NodeElementArchetype.Factory.Input(4, "X", true, typeof(float), 4), NodeElementArchetype.Factory.Input(3, "X", true, typeof(float), 4),
NodeElementArchetype.Factory.Text(30, 4 * Surface.Constants.LayoutOffsetY, "(min: max: )"), NodeElementArchetype.Factory.Text(30, 3 * Surface.Constants.LayoutOffsetY + 2, "(min: max: )"),
NodeElementArchetype.Factory.Float(60, 4 * Surface.Constants.LayoutOffsetY, 0, 0), NodeElementArchetype.Factory.Float(60, 3 * Surface.Constants.LayoutOffsetY + 2, 0, 0),
NodeElementArchetype.Factory.Float(145, 4 * Surface.Constants.LayoutOffsetY, 0, 1), NodeElementArchetype.Factory.Float(145, 3 * Surface.Constants.LayoutOffsetY + 2, 0, 1),
} }
}, },
new NodeArchetype new NodeArchetype
@@ -671,7 +671,7 @@ namespace FlaxEditor.Surface.Archetypes
Title = "Multi Blend 2D", Title = "Multi Blend 2D",
Description = "Animation blending in 2D", Description = "Animation blending in 2D",
Flags = NodeFlags.AnimGraph, Flags = NodeFlags.AnimGraph,
Size = new Float2(420, 320), Size = new Float2(420, 620),
DefaultValues = new object[] DefaultValues = new object[]
{ {
// Node data // Node data
@@ -707,16 +707,16 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Input(2, "Start Position", true, typeof(float), 3, 3), NodeElementArchetype.Factory.Input(2, "Start Position", true, typeof(float), 3, 3),
// Axis X // Axis X
NodeElementArchetype.Factory.Input(4, "X", true, typeof(float), 4), NodeElementArchetype.Factory.Input(3, "X", true, typeof(float), 4),
NodeElementArchetype.Factory.Text(30, 4 * Surface.Constants.LayoutOffsetY, "(min: max: )"), NodeElementArchetype.Factory.Text(30, 3 * Surface.Constants.LayoutOffsetY + 2, "(min: max: )"),
NodeElementArchetype.Factory.Float(60, 4 * Surface.Constants.LayoutOffsetY, 0, 0), NodeElementArchetype.Factory.Float(60, 3 * Surface.Constants.LayoutOffsetY + 2, 0, 0),
NodeElementArchetype.Factory.Float(145, 4 * Surface.Constants.LayoutOffsetY, 0, 1), NodeElementArchetype.Factory.Float(145, 3 * Surface.Constants.LayoutOffsetY + 2, 0, 1),
// Axis Y // Axis Y
NodeElementArchetype.Factory.Input(5, "Y", true, typeof(float), 5), NodeElementArchetype.Factory.Input(4, "Y", true, typeof(float), 5),
NodeElementArchetype.Factory.Text(30, 5 * Surface.Constants.LayoutOffsetY, "(min: max: )"), NodeElementArchetype.Factory.Text(30, 4 * Surface.Constants.LayoutOffsetY + 2, "(min: max: )"),
NodeElementArchetype.Factory.Float(60, 5 * Surface.Constants.LayoutOffsetY, 0, 2), NodeElementArchetype.Factory.Float(60, 4 * Surface.Constants.LayoutOffsetY + 2, 0, 2),
NodeElementArchetype.Factory.Float(145, 5 * Surface.Constants.LayoutOffsetY, 0, 3), NodeElementArchetype.Factory.Float(145, 4 * Surface.Constants.LayoutOffsetY + 2, 0, 3),
} }
}, },
new NodeArchetype new NodeArchetype