diff options
| author | Simon Paul St James <[email protected]> | 2008-11-05 21:54:05 +0000 |
|---|---|---|
| committer | Simon Paul St James <[email protected]> | 2008-11-05 21:54:05 +0000 |
| commit | d5bc6cfa74e21668788d42721dcdb4818a072366 (patch) | |
| tree | ed545220c0a7c015ce25b8b7488d0810bf204d32 /src/dolphindetailsview.cpp | |
| parent | 097457dd7f03bcfa3270848da28030c04bce375c (diff) | |
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: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=880585
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |
