fix box alignment for nodes with fixed size and adjust some node sizes

This commit is contained in:
Saas
2026-03-14 16:38:56 +01:00
parent 2fbeac6077
commit 60076d48c7
4 changed files with 27 additions and 7 deletions

View File

@@ -482,7 +482,8 @@ namespace FlaxEditor.Surface.Archetypes
Create = (id, context, arch, groupArch) => new ConvertToParameterNode(id, context, arch, groupArch, new ScriptType(typeof(bool))),
Description = "Constant boolean value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
UseFixedSize = true,
Size = new Float2(90, 20),
DefaultValues = new object[]
{
false
@@ -515,7 +516,8 @@ namespace FlaxEditor.Surface.Archetypes
Create = (id, context, arch, groupArch) => new ConvertToParameterNode(id, context, arch, groupArch, new ScriptType(typeof(int))),
Description = "Constant integer value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
UseFixedSize = true,
Size = new Float2(120, 20),
DefaultValues = new object[]
{
0
@@ -543,7 +545,8 @@ namespace FlaxEditor.Surface.Archetypes
Create = (id, context, arch, groupArch) => new ConvertToParameterNode(id, context, arch, groupArch, new ScriptType(typeof(float))),
Description = "Constant floating point",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
UseFixedSize = true,
Size = new Float2(120, 20),
DefaultValues = new object[]
{
0.0f
@@ -750,7 +753,8 @@ namespace FlaxEditor.Surface.Archetypes
Title = "PI",
Description = "A value specifying the approximation of π which is 180 degrees",
Flags = NodeFlags.AllGraphs,
Size = new Float2(50, 20),
UseFixedSize = true,
Size = new Float2(45, 20),
Elements = new[]
{
NodeElementArchetype.Factory.Output(0, "π", typeof(float), 0),
@@ -782,7 +786,8 @@ namespace FlaxEditor.Surface.Archetypes
Create = (id, context, arch, groupArch) => new ConvertToParameterNode(id, context, arch, groupArch, new ScriptType(typeof(uint))),
Description = "Constant unsigned integer value",
Flags = NodeFlags.AllGraphs,
Size = new Float2(170, 20),
UseFixedSize = true,
Size = new Float2(130, 20),
DefaultValues = new object[]
{
0u
@@ -824,7 +829,8 @@ namespace FlaxEditor.Surface.Archetypes
Create = (id, context, arch, groupArch) => new ConvertToParameterNode(id, context, arch, groupArch, new ScriptType(typeof(double))),
Description = "Constant floating point",
Flags = NodeFlags.AllGraphs,
Size = new Float2(110, 20),
UseFixedSize = true,
Size = new Float2(120, 20),
DefaultValues = new object[]
{
0.0d

View File

@@ -159,7 +159,8 @@ namespace FlaxEditor.Surface.Archetypes
AlternativeTitles = new string[] { "UV", "UVs" },
Description = "Texture coordinates",
Flags = NodeFlags.MaterialGraph,
Size = new Float2(150, 30),
UseFixedSize = true,
Size = new Float2(160, 20),
DefaultValues = new object[]
{
0u

View File

@@ -129,6 +129,9 @@ namespace FlaxEditor.Surface
/// </summary>
public NodeFlags Flags;
/// <summary>
/// If the node should use the <see cref="Size"/> as node size. If false, the node will auto resize based on its elements.
/// </summary>
public bool UseFixedSize = false;
/// <summary>

View File

@@ -343,6 +343,8 @@ namespace FlaxEditor.Surface
if (!Archetype.UseFixedSize)
ResizeAuto();
else
Resize(Archetype.Size.X, Archetype.Size.Y);
}
/// <summary>
@@ -940,6 +942,8 @@ namespace FlaxEditor.Surface
if (!Archetype.UseFixedSize)
ResizeAuto();
else
Resize(Archetype.Size.X, Archetype.Size.Y);
}
/// <inheritdoc />
@@ -980,6 +984,8 @@ namespace FlaxEditor.Surface
if (!Archetype.UseFixedSize)
ResizeAuto();
else
Resize(Archetype.Size.X, Archetype.Size.Y);
}
/// <summary>
@@ -1017,6 +1023,8 @@ namespace FlaxEditor.Surface
if (!Archetype.UseFixedSize)
ResizeAuto();
else
Resize(Archetype.Size.X, Archetype.Size.Y);
}
internal void SetIsDuringValuesEditing(bool value)
@@ -1051,6 +1059,8 @@ namespace FlaxEditor.Surface
UpdateBoxesTypes();
if (!Archetype.UseFixedSize)
ResizeAuto();
else
Resize(Archetype.Size.X, Archetype.Size.Y);
}
/// <inheritdoc />