From e24529d70d6e541e3587ce8b2b93d429b9f69942 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 2 Jun 2003 23:35:26 +0000 Subject: [PATCH] another bug fixed: wrong lookup of nearest cell before given point git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmlcell.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index b137011895..1e86ed4112 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -747,16 +747,18 @@ wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y, } else if ( flags & wxHTML_FIND_NEAREST_BEFORE ) { - wxHtmlCell *c; + wxHtmlCell *c2, *c = NULL; for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) { if (cell->GetPosY() > y || (cell->GetPosY() == y && cell->GetPosX() > x)) break; - c = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(), - flags); - if (c) return c; + c2 = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(), + flags); + if (c2) + c = c2; } + if (c) return c; } return NULL; -- 2.45.2