mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 03:24:52 +00:00
Merge 0f7220ccc9
into 0565403b15
This commit is contained in:
commit
6d5312a999
1 changed files with 7 additions and 11 deletions
|
@ -862,6 +862,12 @@ void RichText::Paint()
|
|||
if ( m_LineBreaks.IsValidIndex( lineBreakIndexIndex ) && m_LineBreaks[lineBreakIndexIndex] < iLim )
|
||||
iLim = m_LineBreaks[lineBreakIndexIndex];
|
||||
|
||||
// Stop in selection range
|
||||
if ( iLim >= selection0 && i < selection0 )
|
||||
iLim = selection0;
|
||||
if ( iLim >= selection1 && i < selection1 && i >= selection0 )
|
||||
iLim = selection1;
|
||||
|
||||
// Handle non-drawing characters specially
|
||||
for ( int iT = i; iT < iLim; iT++ )
|
||||
{
|
||||
|
@ -1233,8 +1239,6 @@ void RichText::RecalculateLineBreaks()
|
|||
_recalcSavedRenderState = true;
|
||||
if (!HasText())
|
||||
return;
|
||||
|
||||
int selection0 = -1, selection1 = -1;
|
||||
|
||||
// subtract the scrollbar width
|
||||
if (_vertScrollBar->IsVisible())
|
||||
|
@ -1345,16 +1349,8 @@ void RichText::RecalculateLineBreaks()
|
|||
}
|
||||
|
||||
float w = 0;
|
||||
wchar_t wchBefore = 0;
|
||||
wchar_t wchAfter = 0;
|
||||
|
||||
if ( i > 0 && i > lineStartIndex && i != selection0 && i-1 != selection1 )
|
||||
wchBefore = m_TextStream[i-1];
|
||||
if ( i < m_TextStream.Count() - 1 && i+1 != selection0 && i != selection1 )
|
||||
wchAfter = m_TextStream[i+1];
|
||||
|
||||
float flabcA;
|
||||
surface()->GetKernedCharWidth( font, ch, wchBefore, wchAfter, w, flabcA );
|
||||
surface()->GetKernedCharWidth( font, ch, 0, 0, w, flabcA );
|
||||
flLineWidthSoFar += w;
|
||||
|
||||
// See if we've exceeded the width we have available, with
|
||||
|
|
Loading…
Reference in a new issue