| 794 | } |
| 795 | |
| 796 | CLabelResult CUi::DoLabel(const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps) const |
| 797 | { |
| 798 | const int Flags = GetFlagsForLabelProperties(LabelProps, nullptr); |
| 799 | const SCursorAndBoundingBox TextBounds = CalcFontSizeCursorHeightAndBoundingBox(TextRender(), pText, Flags, Size, pRect->w, LabelProps); |
| 800 | const vec2 CursorPos = CalcAlignedCursorPos(pRect, TextBounds.m_TextSize, Align, TextBounds.m_LineCount == 1 ? &TextBounds.m_BiggestCharacterHeight : nullptr); |
| 801 | |
| 802 | CTextCursor Cursor; |
| 803 | Cursor.SetPosition(CursorPos); |
| 804 | Cursor.m_FontSize = Size; |
| 805 | Cursor.m_Flags |= Flags; |
| 806 | Cursor.m_vColorSplits = LabelProps.m_vColorSplits; |
| 807 | Cursor.m_LineWidth = (float)LabelProps.m_MaxWidth; |
| 808 | TextRender()->TextEx(&Cursor, pText, -1); |
| 809 | return CLabelResult{.m_Truncated = Cursor.m_Truncated}; |
| 810 | } |
| 811 | |
| 812 | void CUi::DoLabel(CUIElement::SUIElementRect &RectEl, const CUIRect *pRect, const char *pText, float Size, int Align, const SLabelProperties &LabelProps, int StrLen, const CTextCursor *pReadCursor) const |
| 813 | { |
no test coverage detected