From f40ae806da97ea99b86ab0a0d277f5359a6eb2d9 Mon Sep 17 00:00:00 2001 From: James Johnson Date: Fri, 12 Jan 2018 09:47:43 -0500 Subject: [PATCH] Whitespace marks --- src/dlangui/widgets/editors.d | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 588dd7be..b2e550ac 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -3731,6 +3731,7 @@ class EditBox : EditWidgetBase { } FontRef font = font(); + int previousWraps; for (int i = 0; i < _visibleLines.length; i++) { dstring txt = _visibleLines[i]; Rect lineRect; @@ -3747,7 +3748,16 @@ class EditBox : EditWidgetBase { if (!txt.length && !_wordWrap) continue; 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) { Rect leftPaneRect = visibleRect; 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); } + previousWraps += to!int(wrappedLine.length - 1); } else {