Mercurial > hg > svgui
comparison widgets/Pane.cpp @ 14:aa37f84ab70a
* Add play-selection and looping modes. Looping seems to work OK, but
the plain play-selection is miscalculating current frame number to
feed back to the GUI.
* Cache selection rectanges wherever possible in View::paintEvent.
author | Chris Cannam |
---|---|
date | Tue, 24 Jan 2006 16:20:58 +0000 |
parents | 01849cd277e6 |
children | 4d5d9aba406b |
comparison
equal
deleted
inserted
replaced
13:01849cd277e6 | 14:aa37f84ab70a |
---|---|
443 | 443 |
444 if (!m_manager || !m_manager->isPlaying()) { | 444 if (!m_manager || !m_manager->isPlaying()) { |
445 int offset = mouseFrame - getStartFrame(); | 445 int offset = mouseFrame - getStartFrame(); |
446 int available = getEndFrame() - getStartFrame(); | 446 int available = getEndFrame() - getStartFrame(); |
447 if (offset >= available * 0.9) { | 447 if (offset >= available * 0.9) { |
448 setCentreFrame(m_centreFrame + int(offset - available * 0.9) + 1); | 448 int move = int(offset - available * 0.9) + 1; |
449 setCentreFrame(m_centreFrame + move); | |
449 } else if (offset <= available * 0.15) { | 450 } else if (offset <= available * 0.15) { |
450 setCentreFrame(m_centreFrame - int(available * 0.15 - offset) - 1); | 451 int move = int(available * 0.15 - offset) + 1; |
452 if (m_centreFrame > move) { | |
453 setCentreFrame(m_centreFrame - move); | |
454 } else { | |
455 setCentreFrame(0); | |
456 } | |
451 } | 457 } |
452 } | 458 } |
453 | 459 |
454 update(); | 460 update(); |
455 } | 461 } |