Whitespace marks

This commit is contained in:
James Johnson 2018-01-12 09:47:43 -05:00
parent 87f4a8a918
commit f40ae806da
1 changed files with 12 additions and 1 deletions

View File

@ -3731,6 +3731,7 @@ class EditBox : EditWidgetBase {
} }
FontRef font = font(); FontRef font = font();
int previousWraps;
for (int i = 0; i < _visibleLines.length; i++) { for (int i = 0; i < _visibleLines.length; i++) {
dstring txt = _visibleLines[i]; dstring txt = _visibleLines[i];
Rect lineRect; Rect lineRect;
@ -3747,7 +3748,16 @@ class EditBox : EditWidgetBase {
if (!txt.length && !_wordWrap) if (!txt.length && !_wordWrap)
continue; continue;
if (_showWhiteSpaceMarks) if (_showWhiteSpaceMarks)
drawWhiteSpaceMarks(buf, font, txt, tabSize, lineRect, visibleRect); {
Rect whiteSpaceRc = lineRect;
Rect whiteSpaceRcVisible = visibleRect;
for(int z; z < previousWraps; z++)
{
whiteSpaceRc.offset(0, _lineHeight);
whiteSpaceRcVisible.offset(0, _lineHeight);
}
drawWhiteSpaceMarks(buf, font, txt, tabSize, whiteSpaceRc, whiteSpaceRcVisible);
}
if (_leftPaneWidth > 0) { if (_leftPaneWidth > 0) {
Rect leftPaneRect = visibleRect; Rect leftPaneRect = visibleRect;
leftPaneRect.right = leftPaneRect.left; leftPaneRect.right = leftPaneRect.left;
@ -3779,6 +3789,7 @@ class EditBox : EditWidgetBase {
font.drawText(buf, rc.left - _scrollPos.x, rc.top + lineOffset * _lineHeight, curWrap, textColor, tabSize); font.drawText(buf, rc.left - _scrollPos.x, rc.top + lineOffset * _lineHeight, curWrap, textColor, tabSize);
} }
previousWraps += to!int(wrappedLine.length - 1);
} }
else else
{ {