- if (qAbs(oldpos - newpos) * m_factor > 40) {
- update(oldpos * m_factor - offset() - 6, 7, 17, 16);
- update(newpos * m_factor - offset() - 6, 7, 17, 16);
- } else update(qMin(oldpos, newpos) * m_factor - offset() - 6, 7, qAbs(oldpos - newpos) * m_factor + 17, 16);
+ 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 - m_offset - 6, BIG_MARK_X, (max - min) * m_factor + 14, MAX_HEIGHT - BIG_MARK_X);
+}
+
+void CustomRuler::updateRuler()
+{
+ // Update requested seek position
+ int min = SEEK_INACTIVE;
+ int max = SEEK_INACTIVE;
+ if (m_lastSeekPosition != SEEK_INACTIVE) {
+ min = max = m_lastSeekPosition;
+ }
+ m_lastSeekPosition = m_view->seekPosition();
+ if (m_lastSeekPosition != SEEK_INACTIVE) {
+ if (min == SEEK_INACTIVE) {
+ min = max = m_lastSeekPosition;
+ }
+ else {
+ min = qMin(min, m_lastSeekPosition);
+ max = qMax(max, m_lastSeekPosition);
+ }
+ }
+ if (min != SEEK_INACTIVE) {
+ update(min * m_factor - offset() - 3, BIG_MARK_X, (max - min) * m_factor + 6, MAX_HEIGHT - BIG_MARK_X);
+ }