diff view/Pane.cpp @ 726:62e7d4b378ae tonioni

clicking on selection pane now moves play head to that location
author Justin Salamon <justin.salamon@nyu.edu>
date Tue, 18 Feb 2014 15:29:01 -0500
parents 67b167bb60ab
children 4eb741d63161
line wrap: on
line diff
--- a/view/Pane.cpp	Tue Feb 04 14:35:59 2014 +0000
+++ b/view/Pane.cpp	Tue Feb 18 15:29:01 2014 -0500
@@ -1452,6 +1452,7 @@
 
         if (m_manager && m_manager->haveInProgressSelection()) {
 
+            //cerr << "JTEST: release with selection" << endl;
             bool exclusive;
             Selection selection = m_manager->getInProgressSelection(exclusive);
         
@@ -1467,6 +1468,16 @@
                 m_manager->addSelection(selection);
             }
         }
+        else if (m_manager && !m_manager->haveInProgressSelection()) {
+            
+            //cerr << "JTEST: release without selection" << endl;
+            // Get frame locatrion of mouse
+            int mouseFrame = getFrameForX(e->x());
+            //cerr << "JTEST: frame location of click is " << mouseFrame << endl;
+            // Move play head to that frame location
+            int playbackFrame = fmax(0,mouseFrame);
+            m_manager->setPlaybackFrame(playbackFrame);
+        }
     
         update();