]> git.sesse.net Git - kdenlive/commitdiff
Fix display artifacts in timeline ruler again:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 13 Sep 2012 08:04:21 +0000 (10:04 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 13 Sep 2012 08:04:21 +0000 (10:04 +0200)
http://kdenlive.org/mantis/view.php?id=2724

src/customruler.cpp

index a5b448689efc42766e6737727073d542c8103bb4..1a32d778cd223dbd84a25a155b0d7b3a2729ed98 100644 (file)
@@ -271,10 +271,18 @@ int CustomRuler::offset() const
 
 void CustomRuler::slotCursorMoved(int oldpos, int newpos)
 {
-    if (qAbs(oldpos - newpos) * m_factor > m_textSpacing) {
-        update(oldpos * m_factor - offset() - 6, BIG_MARK_X, 14, MAX_HEIGHT - BIG_MARK_X);
-        update(newpos * m_factor - offset() - 6, BIG_MARK_X, 14, MAX_HEIGHT - BIG_MARK_X);
-    } else update(qMin(oldpos, newpos) * m_factor - offset() - 6, BIG_MARK_X, qAbs(oldpos - newpos) * m_factor + 14, MAX_HEIGHT - BIG_MARK_X);
+    int min = qMin(oldpos, newpos);
+    int max = qMax(oldpos, newpos);
+    if (m_lastSeekPosition != SEEK_INACTIVE) {
+       if (m_lastSeekPosition == newpos) {
+           m_lastSeekPosition = SEEK_INACTIVE;
+       }
+       else {
+           min = qMin(min, m_lastSeekPosition);
+           max = qMax(max, m_lastSeekPosition);
+       }
+    }
+    update(min * m_factor - offset() - 6, BIG_MARK_X, (max - min) * m_factor + 14, MAX_HEIGHT - BIG_MARK_X);
 }
 
 void CustomRuler::updateRuler()