From ad6d547812bf688ea292ca555d4a26e4b3f66ef3 Mon Sep 17 00:00:00 2001 From: James Johnson Date: Thu, 11 Jan 2018 09:19:02 -0500 Subject: [PATCH] Even better, scrolling --- src/dlangui/widgets/editors.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 6dc5fb7e..fcc80671 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -3468,6 +3468,12 @@ class EditBox : EditWidgetBase { if (_contentChanged) needRewrap = true; + if (lastStartingLine != _firstVisibleLine) + { + needRewrap = true; + lastStartingLine = _firstVisibleLine; + } + if (rc.width <= 0 && _wordWrap) { return; @@ -3520,7 +3526,7 @@ class EditBox : EditWidgetBase { CustomCharProps[] wrapProps; foreach (int q, curWrap; wrappedLine) { - auto lineOffset = q + i + wrapsUpTo(i); + auto lineOffset = q + i + wrapsUpTo(i + _firstVisibleLine); if (highlight) { wrapProps = highlight[accumulativeLength .. $];