Small speed-up.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1709,10 +1709,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
if (m_dirty) return;
|
if (m_dirty) return;
|
||||||
if ( !(event.Dragging() || event.ButtonDown() || event.LeftUp() || event.ButtonDClick()) ) return;
|
if ( !(event.Dragging() || event.ButtonDown() || event.LeftUp() || event.ButtonDClick()) ) return;
|
||||||
|
|
||||||
wxClientDC dc(this);
|
int x = event.GetX();
|
||||||
PrepareDC(dc);
|
int y = event.GetY();
|
||||||
wxCoord x = dc.DeviceToLogicalX( (wxCoord)event.GetX() );
|
CalcUnscrolledPosition( x, y, &x, &y );
|
||||||
wxCoord y = dc.DeviceToLogicalY( (wxCoord)event.GetY() );
|
|
||||||
|
|
||||||
/* Did we actually hit an item ? */
|
/* Did we actually hit an item ? */
|
||||||
long hitResult = 0;
|
long hitResult = 0;
|
||||||
@@ -2832,17 +2831,14 @@ long wxListMainWindow::FindItem(long start, long data)
|
|||||||
|
|
||||||
long wxListMainWindow::HitTest( int x, int y, int &flags )
|
long wxListMainWindow::HitTest( int x, int y, int &flags )
|
||||||
{
|
{
|
||||||
wxClientDC dc(this);
|
CalcUnscrolledPosition( x, y, &x, &y );
|
||||||
PrepareDC(dc);
|
|
||||||
wxCoord cx = dc.DeviceToLogicalX( x );
|
|
||||||
wxCoord cy = dc.DeviceToLogicalY( y );
|
|
||||||
|
|
||||||
wxNode *node = m_lines.First();
|
wxNode *node = m_lines.First();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxListLineData *line = (wxListLineData*)node->Data();
|
wxListLineData *line = (wxListLineData*)node->Data();
|
||||||
long ret = line->IsHit( cx, cy );
|
long ret = line->IsHit( x, y );
|
||||||
if (ret & flags)
|
if (ret & flags)
|
||||||
{
|
{
|
||||||
flags = (int)ret;
|
flags = (int)ret;
|
||||||
|
Reference in New Issue
Block a user