void CAbstractTextEdit::Render() { CAbstractLabel::Render(); if(m_Composing) { int FontSize = GetFontSize(); vec4 FontColor = 1.0f; CRect ComposingRect = CRect( GetTextRect().x + GetTextRect().w, GetTextRect().y, TextRenderer()->GetTextWidth(&m_ComposingTextCache), GetTextRect().h ); const CAsset_GuiLabelStyle* pLabelStyle = AssetsManager()->GetAsset<CAsset_GuiLabelStyle>(CAssetPath::GuiLabelStyleSystem(GUILABELSTYLE_COMPOSING)); if(pLabelStyle) { FontSize = Context()->ApplyGuiScale(pLabelStyle->GetFontSize()); FontColor = pLabelStyle->m_TextColor; CRect Rect = ComposingRect; int Padding = Context()->ApplyGuiScale(pLabelStyle->GetPadding()); Rect.AddMargin(Padding); ComposingRect.x += Padding; AssetsRenderer()->DrawGuiRect(&ComposingRect, pLabelStyle->GetRectPath()); } m_ComposingTextCache.SetFontSize(GetFontSize()); m_ComposingTextCache.SetBoxSize(ivec2(-1, ComposingRect.h)); TextRenderer()->DrawText(&m_ComposingTextCache, ivec2(ComposingRect.x, ComposingRect.y), FontColor); } // render the cursor // cursor position if(m_TextCursor.m_TextIter >= 0) { if((2*time_get()/time_freq()) % 2) { Graphics()->TextureClear(); Graphics()->LinesBegin(); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); float x = m_TextCursor.m_Position.x + 0.5f; float y0 = GetTextRect().y; float y1 = GetTextRect().y + GetTextRect().h; IGraphics::CLineItem Line(x, y0, x, y1); Graphics()->LinesDraw(&Line, 1); Graphics()->LinesEnd(); } } }