Merge remote-tracking branch 'origin/master' into 1.12
# Conflicts: # Source/Editor/Options/InterfaceOptions.cs # Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp # Source/Engine/Graphics/Graphics.cpp # Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.cpp # Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.h # Source/Engine/GraphicsDevice/Vulkan/Config.h # Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp # Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h # Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.cpp
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -191,14 +191,18 @@ namespace FlaxEngine.GUI
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum number of characters the user can type into the text box control.
|
||||
/// </summary>
|
||||
[EditorOrder(50), Tooltip("The maximum number of characters the user can type into the text box control.")]
|
||||
[EditorOrder(50), Limit(-1), Tooltip("The maximum number of characters the user can type into the text box control.")]
|
||||
public int MaxLength
|
||||
{
|
||||
get => _maxLength;
|
||||
set
|
||||
{
|
||||
if (_maxLength <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(MaxLength));
|
||||
// Cap at min of -1 for no max length
|
||||
if (value <= 0)
|
||||
{
|
||||
_maxLength = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_maxLength != value)
|
||||
{
|
||||
@@ -275,7 +279,7 @@ namespace FlaxEngine.GUI
|
||||
/// Gets or sets the speed of the caret flashing animation.
|
||||
/// </summary>
|
||||
[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;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed of the selection background flashing animation.
|
||||
@@ -381,7 +385,7 @@ namespace FlaxEngine.GUI
|
||||
value = value.Replace(DelChar.ToString(), "");
|
||||
|
||||
// Clamp length
|
||||
if (value.Length > MaxLength)
|
||||
if (value.Length > MaxLength && MaxLength != -1)
|
||||
value = value.Substring(0, MaxLength);
|
||||
|
||||
// Ensure to use only single line
|
||||
@@ -514,7 +518,7 @@ namespace FlaxEngine.GUI
|
||||
AutoFocus = true;
|
||||
|
||||
_isMultiline = isMultiline;
|
||||
_maxLength = 2147483646;
|
||||
_maxLength = -1;
|
||||
_selectionStart = _selectionEnd = -1;
|
||||
|
||||
var style = Style.Current;
|
||||
@@ -710,7 +714,7 @@ namespace FlaxEngine.GUI
|
||||
str = str.Replace("\n", "");
|
||||
|
||||
int selectionLength = SelectionLength;
|
||||
int charactersLeft = MaxLength - _text.Length + selectionLength;
|
||||
int charactersLeft = (MaxLength != -1 ? MaxLength : int.MaxValue) - _text.Length + selectionLength;
|
||||
Assert.IsTrue(charactersLeft >= 0);
|
||||
if (charactersLeft == 0)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user