From db46050b16814cd983a003a66adc87c729d48afb Mon Sep 17 00:00:00 2001 From: Saas Date: Sun, 1 Mar 2026 11:01:55 +0100 Subject: [PATCH] tweak caret blink speed --- Source/Engine/UI/GUI/Common/RichTextBoxBase.cs | 4 ++-- Source/Engine/UI/GUI/Common/TextBox.cs | 4 ++-- Source/Engine/UI/GUI/Common/TextBoxBase.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs b/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs index 2fc2ef4b3..7722fc94b 100644 --- a/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs @@ -437,8 +437,8 @@ namespace FlaxEngine.GUI // Caret if (IsFocused && CaretPosition > -1) { - float alpha = Mathf.Saturate(Mathf.Cos(_animateTime * CaretFlashSpeed) * 0.5f + 0.7f); - alpha = alpha * alpha * alpha * alpha * alpha * alpha; + float alpha = Mathf.Saturate(Mathf.Cos(_animateTime * CaretFlashSpeed) * 0.5f + 0.8f); + alpha = alpha * alpha; Render2D.FillRectangle(CaretBounds, CaretColor * alpha); } diff --git a/Source/Engine/UI/GUI/Common/TextBox.cs b/Source/Engine/UI/GUI/Common/TextBox.cs index 1dfd9facc..3d7099db6 100644 --- a/Source/Engine/UI/GUI/Common/TextBox.cs +++ b/Source/Engine/UI/GUI/Common/TextBox.cs @@ -310,8 +310,8 @@ namespace FlaxEngine.GUI // Caret if (IsFocused && CaretPosition > -1) { - float alpha = Mathf.Saturate(Mathf.Cos(_animateTime * CaretFlashSpeed) * 0.5f + 0.7f); - alpha = alpha * alpha * alpha * alpha * alpha * alpha; + float alpha = Mathf.Saturate(Mathf.Cos(_animateTime * CaretFlashSpeed) * 0.5f + 0.8f); + alpha = alpha * alpha; Render2D.FillRectangle(CaretBounds, CaretColor * alpha); } diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index 243e4786e..7deb9a367 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -275,7 +275,7 @@ namespace FlaxEngine.GUI /// Gets or sets the speed of the caret flashing animation. /// [EditorDisplay("Caret Style"), EditorOrder(2021), Tooltip("The speed of the caret flashing animation.")] - public float CaretFlashSpeed { get; set; } = 6.0f; + public float CaretFlashSpeed { get; set; } = 6.5f; /// /// Gets or sets the speed of the selection background flashing animation.