Sort of working

This commit is contained in:
James Johnson 2018-01-11 08:50:59 -05:00
parent 8df39f232b
commit 761a7bc821
1 changed files with 21 additions and 2 deletions

View File

@ -474,6 +474,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
/// information about line span into several lines - in word wrap mode /// information about line span into several lines - in word wrap mode
protected LineSpan[] _span; protected LineSpan[] _span;
protected LineSpan[] _spanCache;
//Finds good visual wrapping point for string //Finds good visual wrapping point for string
int findWrapPoint(dstring text) int findWrapPoint(dstring text)
@ -508,7 +509,14 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
int wrapsUpTo(int line) int wrapsUpTo(int line)
{ {
if(line < _span.length) int sum;
lineSpanIterate(delegate(int wantedLine, int wantedWrap)
{
if (wantedLine < line)
sum += _span[wantedLine].len - 1;
});
return sum;
/*if(line < _span.length)
{ {
int sum; int sum;
@ -518,8 +526,19 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
} }
//Log.d(sum); //Log.d(sum);
return sum; return sum;
}*/
//return 0;
}
void lineSpanIterate(void delegate(int wantedLine, int wantedWrap) iterator)
{
for (int i; i<_span.length; i++)
{
for (int q; q<_span[i].wrapPoints.length; q++)
{
iterator(i, q);
}
} }
return 0;
} }
/// override to add custom items on left panel /// override to add custom items on left panel