From 828fe3bc1228b5a4f3861f0d38e54c55870023d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 5 Feb 2002 16:30:56 +0000 Subject: [PATCH] remove stupid endless loop git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3488 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index e179276a79..64fbade29c 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1193,18 +1193,18 @@ bool MathCursor::bruteFind(int x, int y, int xlow, int xhigh, int ylow, int yhig MathIterator it = ibegin(formula()->par().nucleus()); MathIterator et = iend(formula()->par().nucleus()); while (1) { - // avoid invalid nesting hen selecting - if (selection_ && !positionable(it.cursor(), Anchor_)) - continue; - int xo = it.position().xpos(); - int yo = it.position().ypos(); - if (xlow - 2 <= xo && xo <= xhigh + 2 && - ylow - 2 <= yo && yo <= yhigh + 2) - { - double d = (x - xo) * (x - xo) + (y - yo) * (y - yo); - if (d < best_dist) { - best_dist = d; - best_cursor = it.cursor(); + // avoid invalid nesting when selecting + if (!selection_ || positionable(it.cursor(), Anchor_)) { + int xo = it.position().xpos(); + int yo = it.position().ypos(); + if (xlow - 2 <= xo && xo <= xhigh + 2 && + ylow - 2 <= yo && yo <= yhigh + 2) + { + double d = (x - xo) * (x - xo) + (y - yo) * (y - yo); + if (d < best_dist) { + best_dist = d; + best_cursor = it.cursor(); + } } } -- 2.39.2