]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistrubberband.cpp
Load KFileItemAction plugins with json metadata
[dolphin.git] / src / kitemviews / private / kitemlistrubberband.cpp
index ae023d2aac59500c293c76fd30a4203a1bc92d82..70287312638f4a7bf4c4fce807e43644f281a785 100644 (file)
@@ -50,6 +50,22 @@ void KItemListRubberBand::setEndPosition(const QPointF& pos)
     if (m_endPos != pos) {
         const QPointF previous = m_endPos;
         m_endPos = pos;
+
+        if (m_startPos.x() == m_endPos.x()) {
+            if (previous.x() < m_startPos.x()) {
+                m_endPos.rx() = m_startPos.x() - 1.0;
+            } else {
+                m_endPos.rx() = m_startPos.x() + 1.0;
+            }
+        }
+        if (m_startPos.y() == m_endPos.y()) {
+            if (previous.y() < m_startPos.y()) {
+                m_endPos.ry() = m_startPos.y() - 1.0;
+            } else {
+                m_endPos.ry() = m_startPos.y() + 1.0;
+            }
+        }
+
         emit endPositionChanged(m_endPos, previous);
     }
 }
@@ -72,4 +88,3 @@ bool KItemListRubberBand::isActive() const
     return m_active;
 }
 
-#include "kitemlistrubberband.moc"