MCPcopy Create free account
hub / github.com/MyGUI/mygui / drawGlyph

Method drawGlyph

MyGUIEngine/src/MyGUI_EditText.cpp:701–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699 }
700
701 void EditText::drawGlyph(
702 const RenderTargetInfo& _renderTargetInfo,
703 Vertex*& _vertex,
704 size_t& _vertexCount,
705 FloatRect _vertexRect,
706 FloatRect _textureRect,
707 uint32 _colour) const
708 {
709 // символ залазиет влево
710 float leftClip = (float)mCurrentCoord.left - _vertexRect.left;
711 if (leftClip > 0.0f)
712 {
713 if ((float)mCurrentCoord.left < _vertexRect.right)
714 {
715 _textureRect.left += _textureRect.width() * leftClip / _vertexRect.width();
716 _vertexRect.left += leftClip;
717 }
718 else
719 {
720 return;
721 }
722 }
723
724 // символ залазиет вправо
725 float rightClip = _vertexRect.right - (float)mCurrentCoord.right();
726 if (rightClip > 0.0f)
727 {
728 if (_vertexRect.left < (float)mCurrentCoord.right())
729 {
730 _textureRect.right -= _textureRect.width() * rightClip / _vertexRect.width();
731 _vertexRect.right -= rightClip;
732 }
733 else
734 {
735 return;
736 }
737 }
738
739 // символ залазиет вверх
740 float topClip = (float)mCurrentCoord.top - _vertexRect.top;
741 if (topClip > 0.0f)
742 {
743 if ((float)mCurrentCoord.top < _vertexRect.bottom)
744 {
745 _textureRect.top += _textureRect.height() * topClip / _vertexRect.height();
746 _vertexRect.top += topClip;
747 }
748 else
749 {
750 return;
751 }
752 }
753
754 // символ залазиет вниз
755 float bottomClip = _vertexRect.bottom - (float)mCurrentCoord.bottom();
756 if (bottomClip > 0.0f)
757 {
758 if (_vertexRect.top < (float)mCurrentCoord.bottom())

Callers

nothing calls this directly

Calls 5

rightMethod · 0.80
bottomMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45
getNodeDepthMethod · 0.45

Tested by

no test coverage detected