mirror of https://github.com/buggins/dlangui.git
Improved efficiency a bit
This commit is contained in:
parent
bc40bbf561
commit
bd721d590e
|
@ -533,11 +533,12 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
{
|
{
|
||||||
int curWrapLine = 0;
|
int curWrapLine = 0;
|
||||||
int curPosition = textPos.pos;
|
int curPosition = textPos.pos;
|
||||||
|
LineSpan curSpan = getSpan(textPos.line);
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (curWrapLine == getSpan(textPos.line).wrapPoints.length - 1)
|
if (curWrapLine == curSpan.wrapPoints.length - 1)
|
||||||
return curWrapLine;
|
return curWrapLine;
|
||||||
curPosition -= getSpan(textPos.line).wrapPoints[curWrapLine].wrapPos;
|
curPosition -= curSpan.wrapPoints[curWrapLine].wrapPos;
|
||||||
if (curPosition < 0)
|
if (curPosition < 0)
|
||||||
{
|
{
|
||||||
return curWrapLine;
|
return curWrapLine;
|
||||||
|
|
Loading…
Reference in New Issue