changeset 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
files widgets/Pane.cpp
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/Pane.cpp	Mon Jan 23 17:02:57 2006 +0000
+++ b/widgets/Pane.cpp	Tue Jan 24 16:20:58 2006 +0000
@@ -445,9 +445,15 @@
 	    int offset = mouseFrame - getStartFrame();
 	    int available = getEndFrame() - getStartFrame();
 	    if (offset >= available * 0.9) {
-		setCentreFrame(m_centreFrame + int(offset - available * 0.9) + 1);
+		int move = int(offset - available * 0.9) + 1;
+		setCentreFrame(m_centreFrame + move);
 	    } else if (offset <= available * 0.15) {
-		setCentreFrame(m_centreFrame - int(available * 0.15 - offset) - 1);
+		int move = int(available * 0.15 - offset) + 1;
+		if (m_centreFrame > move) {
+		    setCentreFrame(m_centreFrame - move);
+		} else {
+		    setCentreFrame(0);
+		}
 	    }
 	}