Add option to disable text clipping in text boxes

This commit is contained in:
Wojciech Figat
2022-08-05 14:38:18 +02:00
parent b23cf5f1d8
commit 9caf80bdc9
3 changed files with 14 additions and 4 deletions

View File

@@ -158,7 +158,8 @@ namespace FlaxEngine.GUI
Render2D.DrawRectangle(rect, IsFocused ? BorderSelectedColor : BorderColor);
// Apply view offset and clip mask
Render2D.PushClip(TextClipRectangle);
if (ClipText)
Render2D.PushClip(TextClipRectangle);
bool useViewOffset = !_viewOffset.IsZero;
if (useViewOffset)
Render2D.PushTransform(Matrix3x3.Translation2D(-_viewOffset));
@@ -226,7 +227,8 @@ namespace FlaxEngine.GUI
// Restore rendering state
if (useViewOffset)
Render2D.PopTransform();
Render2D.PopClip();
if (ClipText)
Render2D.PopClip();
}
/// <inheritdoc />