mirror of https://github.com/buggins/dlangui.git
Removed some redundant parts from findWrapLine
This commit is contained in:
parent
83a2f2ef5c
commit
bc40bbf561
|
@ -531,20 +531,18 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
|
|
||||||
int findWrapLine(TextPosition textPos)
|
int findWrapLine(TextPosition textPos)
|
||||||
{
|
{
|
||||||
int curLine = 0;
|
int curWrapLine = 0;
|
||||||
int curPosition = textPos.pos;
|
int curPosition = textPos.pos;
|
||||||
int i = 0;
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (i == getSpan(textPos.line).wrapPoints.length - 1)
|
if (curWrapLine == getSpan(textPos.line).wrapPoints.length - 1)
|
||||||
return curLine;
|
return curWrapLine;
|
||||||
curPosition -= getSpan(textPos.line).wrapPoints[i].wrapPos;
|
curPosition -= getSpan(textPos.line).wrapPoints[curWrapLine].wrapPos;
|
||||||
if (curPosition < 0)
|
if (curPosition < 0)
|
||||||
{
|
{
|
||||||
return curLine;
|
return curWrapLine;
|
||||||
}
|
}
|
||||||
curLine++;
|
curWrapLine++;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue