From 7737dbc77f93ce4529e4b41b51d2f73cfde54421 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 1 Apr 2026 15:58:31 +0200 Subject: [PATCH] Various minor fixes #3866 --- Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs | 5 +++++ Source/Editor/Surface/Archetypes/BehaviorTree.cs | 7 +++---- Source/Editor/Surface/Archetypes/Material.cs | 4 ++-- Source/Editor/Surface/Constants.cs | 2 +- Source/Editor/Surface/VisjectSurface.cs | 2 +- Source/Engine/Core/Math/Rectangle.cs | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs index 1d842a7c3..cb8681be0 100644 --- a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs +++ b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs @@ -569,6 +569,9 @@ namespace FlaxEditor.Surface.Archetypes // Grid _node.DrawEditorGrid(ref rect); + var features = Render2D.Features; + Render2D.Features = features & ~Render2D.RenderingFeatures.VertexSnapping; + base.Draw(); // Draw debug position @@ -584,6 +587,8 @@ namespace FlaxEditor.Surface.Archetypes Render2D.DrawSprite(icon, debugRect, style.ProgressNormal); } + Render2D.Features = features; + // Frame var frameColor = containsFocus ? style.BackgroundSelected : (IsMouseOver ? style.ForegroundGrey : style.ForegroundDisabled); Render2D.DrawRectangle(new Rectangle(1, 1, rect.Width - 2, rect.Height - 2), frameColor); diff --git a/Source/Editor/Surface/Archetypes/BehaviorTree.cs b/Source/Editor/Surface/Archetypes/BehaviorTree.cs index d99fedaee..cdc223a8d 100644 --- a/Source/Editor/Surface/Archetypes/BehaviorTree.cs +++ b/Source/Editor/Surface/Archetypes/BehaviorTree.cs @@ -190,7 +190,6 @@ namespace FlaxEditor.Surface.Archetypes public override void Draw() { var style = Style.Current; - var backgroundRect = new Rectangle(Float2.Zero, Size); // Shadow @@ -201,7 +200,7 @@ namespace FlaxEditor.Surface.Archetypes } // Background - Render2D.FillRectangle(backgroundRect, ArchetypeColor); + Render2D.FillRectangle(backgroundRect, BackgroundColor); // Breakpoint hit if (Breakpoint.Hit) @@ -819,10 +818,10 @@ namespace FlaxEditor.Surface.Archetypes { base.OnSurfaceLoaded(action); + var node = Node; if (action == SurfaceNodeActions.Undo) { // Update parent node layout when restoring decorator from undo - var node = Node; if (node != null) { node._decorators = null; @@ -832,7 +831,7 @@ namespace FlaxEditor.Surface.Archetypes else { // Correctly size decorators when surface is loaded - Node.ResizeAuto(); + node?.ResizeAuto(); } } diff --git a/Source/Editor/Surface/Archetypes/Material.cs b/Source/Editor/Surface/Archetypes/Material.cs index d9890f031..1e93e7a9d 100644 --- a/Source/Editor/Surface/Archetypes/Material.cs +++ b/Source/Editor/Surface/Archetypes/Material.cs @@ -932,7 +932,7 @@ namespace FlaxEditor.Surface.Archetypes new NodeArchetype { TypeID = 36, - Title = "HSVToRGB", + Title = "HSV To RGB", Description = "Converts a HSV value to linear RGB [X = 0/360, Y = 0/1, Z = 0/1]", Flags = NodeFlags.MaterialGraph, Size = new Float2(160, 25), @@ -949,7 +949,7 @@ namespace FlaxEditor.Surface.Archetypes new NodeArchetype { TypeID = 37, - Title = "RGBToHSV", + Title = "RGB To HSV", Description = "Converts a linear RGB value to HSV [X = 0/360, Y = 0/1, Z = 0/1]", Flags = NodeFlags.MaterialGraph, Size = new Float2(160, 25), diff --git a/Source/Editor/Surface/Constants.cs b/Source/Editor/Surface/Constants.cs index 474d3979b..eba53cc69 100644 --- a/Source/Editor/Surface/Constants.cs +++ b/Source/Editor/Surface/Constants.cs @@ -46,7 +46,7 @@ namespace FlaxEditor.Surface public const float NodeMarginY = 8.0f; /// - /// The width of the row that is started by a box. + /// The size of the row that is started by a box. /// public const float BoxRowHeight = 19.0f; diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs index 9f0d78bf6..55c643f12 100644 --- a/Source/Editor/Surface/VisjectSurface.cs +++ b/Source/Editor/Surface/VisjectSurface.cs @@ -511,7 +511,7 @@ namespace FlaxEditor.Surface { GroupID = Custom.GroupID, Name = "Custom", - Color = Color.Wheat + Color = Color.Wheat.RGBMultiplied(0.4f), }; } else diff --git a/Source/Engine/Core/Math/Rectangle.cs b/Source/Engine/Core/Math/Rectangle.cs index db34f8f83..fcded50ce 100644 --- a/Source/Engine/Core/Math/Rectangle.cs +++ b/Source/Engine/Core/Math/Rectangle.cs @@ -260,7 +260,7 @@ namespace FlaxEngine /// Offseted rectangle. public Rectangle MakeOffsetted(float offset) { - return new Rectangle(Location + new Float2(offset, offset), Size); + return new Rectangle(Location + offset, Size); } ///