Add option to disable text clipping in text boxes
This commit is contained in:
@@ -235,7 +235,8 @@ namespace FlaxEngine.GUI
|
|||||||
Render2D.DrawRectangle(rect, IsFocused ? BorderSelectedColor : BorderColor);
|
Render2D.DrawRectangle(rect, IsFocused ? BorderSelectedColor : BorderColor);
|
||||||
|
|
||||||
// Apply view offset and clip mask
|
// Apply view offset and clip mask
|
||||||
Render2D.PushClip(TextClipRectangle);
|
if (ClipText)
|
||||||
|
Render2D.PushClip(TextClipRectangle);
|
||||||
bool useViewOffset = !_viewOffset.IsZero;
|
bool useViewOffset = !_viewOffset.IsZero;
|
||||||
if (useViewOffset)
|
if (useViewOffset)
|
||||||
Render2D.PushTransform(Matrix3x3.Translation2D(-_viewOffset));
|
Render2D.PushTransform(Matrix3x3.Translation2D(-_viewOffset));
|
||||||
@@ -355,7 +356,8 @@ namespace FlaxEngine.GUI
|
|||||||
// Restore rendering state
|
// Restore rendering state
|
||||||
if (useViewOffset)
|
if (useViewOffset)
|
||||||
Render2D.PopTransform();
|
Render2D.PopTransform();
|
||||||
Render2D.PopClip();
|
if (ClipText)
|
||||||
|
Render2D.PopClip();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -158,7 +158,8 @@ namespace FlaxEngine.GUI
|
|||||||
Render2D.DrawRectangle(rect, IsFocused ? BorderSelectedColor : BorderColor);
|
Render2D.DrawRectangle(rect, IsFocused ? BorderSelectedColor : BorderColor);
|
||||||
|
|
||||||
// Apply view offset and clip mask
|
// Apply view offset and clip mask
|
||||||
Render2D.PushClip(TextClipRectangle);
|
if (ClipText)
|
||||||
|
Render2D.PushClip(TextClipRectangle);
|
||||||
bool useViewOffset = !_viewOffset.IsZero;
|
bool useViewOffset = !_viewOffset.IsZero;
|
||||||
if (useViewOffset)
|
if (useViewOffset)
|
||||||
Render2D.PushTransform(Matrix3x3.Translation2D(-_viewOffset));
|
Render2D.PushTransform(Matrix3x3.Translation2D(-_viewOffset));
|
||||||
@@ -226,7 +227,8 @@ namespace FlaxEngine.GUI
|
|||||||
// Restore rendering state
|
// Restore rendering state
|
||||||
if (useViewOffset)
|
if (useViewOffset)
|
||||||
Render2D.PopTransform();
|
Render2D.PopTransform();
|
||||||
Render2D.PopClip();
|
if (ClipText)
|
||||||
|
Render2D.PopClip();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -192,6 +192,12 @@ namespace FlaxEngine.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether apply clipping mask on text during rendering.
|
||||||
|
/// </summary>
|
||||||
|
[EditorOrder(529)]
|
||||||
|
public bool ClipText { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets textbox background color when the control is selected (has focus).
|
/// Gets or sets textbox background color when the control is selected (has focus).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user