From ac8d1e668ebd78bb35c62c4c8117d5c9f1ac0e57 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 13 Sep 2012 10:04:21 +0200 Subject: [PATCH] Fix display artifacts in timeline ruler again: http://kdenlive.org/mantis/view.php?id=2724 --- src/customruler.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/customruler.cpp b/src/customruler.cpp index a5b44868..1a32d778 100644 --- a/src/customruler.cpp +++ b/src/customruler.cpp @@ -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() -- 2.39.2