diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 47b0e3b80..fd0e8ece0 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -800,6 +800,7 @@ public: pCursor->m_LongestLineWidth = 0; pCursor->m_CalculateSelectionMode = TEXT_CURSOR_SELECTION_MODE_NONE; + pCursor->m_SelectionHeightFactor = 1.0f; pCursor->m_PressMouseX = 0; pCursor->m_PressMouseY = 0; pCursor->m_ReleaseMouseX = 0; @@ -1409,7 +1410,7 @@ public: if(SelectionStarted && IsRendered) { - vSelectionQuads.emplace_back(SelX, DrawY, SelWidth, Size); + vSelectionQuads.emplace_back(SelX, DrawY + (1.0f - pCursor->m_SelectionHeightFactor) * Size, SelWidth, pCursor->m_SelectionHeightFactor * Size); } LastSelX = SelX; diff --git a/src/engine/textrender.h b/src/engine/textrender.h index 23ad9d806..05ee344de 100644 --- a/src/engine/textrender.h +++ b/src/engine/textrender.h @@ -183,6 +183,7 @@ public: float m_AlignedFontSize; ETextCursorSelectionMode m_CalculateSelectionMode; + float m_SelectionHeightFactor; // these coordinates are repsected if selection mode is set to calculate @see ETextCursorSelectionMode int m_PressMouseX;