Helper class for calculating offsets for visualizing multi-line selection. More...
#include <UiTextComponentOffsetsSelector.h>
Public Member Functions | |
UiTextComponentOffsetsSelector (const UiTextComponent::DrawBatchLines &drawBatchLines, const STextDrawContext &fontContext, float fontSize, int firstIndex, int lastIndex, int lastIndexLineNumber, int lineNumHint) | |
void | ParseBatchLine (const UiTextComponent::DrawBatchLine &batchLine, float &curLineWidth) |
Parses all the DrawBatch string content of a DrawBatchLine for offsets calculation. | |
void | HandleTopAndMiddleOffsets () |
Handles top and middle offset section cases. | |
void | IncrementYOffsets () |
Condition y-offset incrementing for whatever is on the top of the stack. | |
void | CalculateOffsets (UiTextComponent::LineOffsets &top, UiTextComponent::LineOffsets &middle, UiTextComponent::LineOffsets &bottom) |
Parses entirety of DrawBatchLines of text and assigns values to top, middle, and bottom offsets accordingly. | |
Public Attributes | |
AZStd::stack< UiTextComponent::LineOffsets * > | lineOffsetsStack |
const UiTextComponent::DrawBatchLines & | m_drawBatchLines |
const STextDrawContext & | m_fontContext |
const float | m_fontSize |
float | m_maxLineHeight |
const int | m_firstIndex |
const int | m_lastIndex |
const int | m_lastIndexLineNumber |
Used to determine location within "middle" section. | |
const int | m_numLines |
int | m_indexIter |
Index for iterating over displaying string (m_locText) | |
int | m_numCharsSelected |
int | m_lineCounter |
int | m_lineNumHint |
bool | firstLine = true |
bool | firstIndexFound = false |
bool | lastIndexFound = false |
bool | firstAndLastIndexOccurOnDifferentLines = false |
Helper class for calculating offsets for visualizing multi-line selection.
AZStd::stack<UiTextComponent::LineOffsets*> UiTextComponentOffsetsSelector::lineOffsetsStack |
A multi-line selection can be divided into three offsets: the first line (top), the last line (bottom), and a multi-line middle section that is basically a rect.
Each LineOffset contains a Vec2 for left and right offsets. The left offset is "absolute" for the element rect whereas the right offset is relative to the left offset.