From 3279016067f4ef1ead1c6f2fb8b3c04b25cd92f4 Mon Sep 17 00:00:00 2001 From: Saas Date: Sat, 20 Dec 2025 20:32:40 +0100 Subject: [PATCH] tweak some node spacing --- Source/Editor/Surface/Constants.cs | 22 ++++++++++++++------- Source/Editor/Surface/Elements/InputBox.cs | 2 +- Source/Editor/Surface/Elements/OutputBox.cs | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Surface/Constants.cs b/Source/Editor/Surface/Constants.cs index 58dee6084..bec0b5183 100644 --- a/Source/Editor/Surface/Constants.cs +++ b/Source/Editor/Surface/Constants.cs @@ -13,7 +13,7 @@ namespace FlaxEditor.Surface /// /// The node close button size. /// - public const float NodeCloseButtonSize = 12.0f; + public const float NodeCloseButtonSize = 16.0f; /// /// The node close button margin from the edges. @@ -25,6 +25,9 @@ namespace FlaxEditor.Surface /// public const float NodeHeaderHeight = 20.0f; + /// + /// The scale of the header text. + /// public const float NodeHeaderTextScale = 0.65f; /// @@ -33,14 +36,14 @@ namespace FlaxEditor.Surface public const float NodeFooterSize = 2.0f; /// - /// The node left margin. + /// The horizontal node margin. /// public const float NodeMarginX = 8.0f; /// - /// The node right margin. + /// The vertical node right margin. /// - public const float NodeMarginY = 5.0f; + public const float NodeMarginY = 7.0f; /// /// The box position offset on the x axis. @@ -50,7 +53,7 @@ namespace FlaxEditor.Surface /// /// The width of the row that is started by a box. /// - public const float BoxRowHeight = 18.0f; + public const float BoxRowHeight = 19.0f; /// /// The box size (with and height). @@ -60,7 +63,7 @@ namespace FlaxEditor.Surface /// /// The node layout offset on the y axis (height of the boxes rows, etc.). It's used to make the design more consistent. /// - public const float LayoutOffsetY = 22.0f; + public const float LayoutOffsetY = 24.0f; /// /// The offset between the box text and the box @@ -70,6 +73,11 @@ namespace FlaxEditor.Surface /// /// The width of the rectangle used to draw the box text. /// - public const float BoxTextRectWidth = 1410.0f; + public const float BoxTextRectWidth = 500.0f; + + /// + /// The scale of text of boxes. + /// + public const float BoxTextScale = 1.175f; } } diff --git a/Source/Editor/Surface/Elements/InputBox.cs b/Source/Editor/Surface/Elements/InputBox.cs index 113da6c68..5a4bfc31c 100644 --- a/Source/Editor/Surface/Elements/InputBox.cs +++ b/Source/Editor/Surface/Elements/InputBox.cs @@ -1443,7 +1443,7 @@ namespace FlaxEditor.Surface.Elements // Draw text var style = Style.Current; var rect = new Rectangle(Width + Constants.BoxTextOffset, 0, Constants.BoxTextRectWidth, Height); - Render2D.DrawText(style.FontSmall, Text, rect, Enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Near, TextAlignment.Center); + Render2D.DrawText(style.FontMedium, Text, rect, Enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Near, TextAlignment.Center, TextWrapping.NoWrap, 1f, Constants.BoxTextScale); } /// diff --git a/Source/Editor/Surface/Elements/OutputBox.cs b/Source/Editor/Surface/Elements/OutputBox.cs index 025b16f4b..3e473d7ac 100644 --- a/Source/Editor/Surface/Elements/OutputBox.cs +++ b/Source/Editor/Surface/Elements/OutputBox.cs @@ -235,7 +235,7 @@ namespace FlaxEditor.Surface.Elements // Draw text var style = Style.Current; var rect = new Rectangle(-Constants.BoxTextRectWidth - Constants.BoxTextOffset, 0, Constants.BoxTextRectWidth, Height); - Render2D.DrawText(style.FontSmall, Text, rect, Enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Far, TextAlignment.Center); + Render2D.DrawText(style.FontMedium, Text, rect, Enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Far, TextAlignment.Center, TextWrapping.NoWrap, 1f, Constants.BoxTextScale); } } }