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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user