From: Simon Paul St James Date: Wed, 5 Nov 2008 21:54:05 +0000 (+0000) Subject: If the elastic band ventures beyond the logical top-left of the view (NOTE: not the... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d5bc6cfa74e21668788d42721dcdb4818a072366 If the elastic band ventures beyond the logical top-left of the view (NOTE: not the viewport), then startIndex will likely be invalid, resulting in broken selection behaviour. Prevent this. CCMAIL: peter.penz@gmx.at svn path=/trunk/KDE/kdebase/apps/; revision=880585 --- diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 883f5a774..3fa7ae196 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -514,6 +514,13 @@ void DolphinDetailsView::updateElasticBand() QRect dirtyRegion(elasticBandRect()); const QPoint scrollPos(horizontalScrollBar()->value(), verticalScrollBar()->value()); m_band.destination = viewport()->mapFromGlobal(QCursor::pos()) + scrollPos; + // Going above the (logical) top-left of the view causes complications during selection; + // we may as well prevent it. + if (m_band.destination.y() < 0) + m_band.destination.setY(0); + if (m_band.destination.x() < 0) + m_band.destination.setX(0); + dirtyRegion = dirtyRegion.united(elasticBandRect()); setDirtyRegion(dirtyRegion); }