Add Wrap Support on Rich Text Box

Merges #4196
This commit is contained in:
Phantom
2026-09-20 00:22:04 +02:00
committed by mafiesto4
parent d1148fdcfd
commit 26d508684b
3 changed files with 154 additions and 27 deletions
+12 -8
View File
@@ -100,15 +100,19 @@ namespace FlaxEngine.GUI
}
// Handle case when index is outside all text ranges
if (index >= 0 && blockCount > 0 && index <= textBlocksSpan[0].Range.StartIndex)
if (index >= 0 && blockCount > 0)
{
result = textBlocksSpan[0];
return true;
}
if (index >= 0 && blockCount > 0 && index >= textBlocksSpan[blockCount - 1].Range.StartIndex)
{
result = textBlocksSpan[blockCount - 1];
return true;
if (index <= textBlocksSpan[0].Range.StartIndex)
{
result = textBlocksSpan[0];
return true;
}
if (index >= textBlocksSpan[blockCount - 1].Range.StartIndex)
{
result = textBlocksSpan[blockCount - 1];
return true;
}
}
// If no text block is found