fix editors cursor placement

This commit is contained in:
Vadim Lopatin 2015-02-11 13:36:34 +03:00
parent 9f01f14645
commit b037625854
2 changed files with 3 additions and 2 deletions

View File

@ -66,7 +66,7 @@
<debuglevel>0</debuglevel>
<debugids>DebugFocus</debugids>
<versionlevel>0</versionlevel>
<versionids>EmbedStandardResources Unicode USE_FREETYPE USE_SDL</versionids>
<versionids>EmbedStandardResources Unicode USE_FREETYPE</versionids>
<dump_source>0</dump_source>
<mapverbosity>0</mapverbosity>
<createImplib>1</createImplib>

View File

@ -1844,7 +1844,8 @@ class EditBox : EditWidgetBase {
lineIndex = 0;
if (lineIndex < _visibleLines.length) {
res.line = lineIndex + _firstVisibleLine;
for (int i = 0; i < _visibleLinesMeasurement[lineIndex].length; i++) {
int len = cast(int)_visibleLines[lineIndex].length;
for (int i = 0; i < len; i++) {
int x0 = i > 0 ? _visibleLinesMeasurement[lineIndex][i - 1] : 0;
int x1 = _visibleLinesMeasurement[lineIndex][i];
int mx = (x0 + x1) >> 1;