Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
723:d1c0abfb11be | 726:62e7d4b378ae |
---|---|
1450 return; | 1450 return; |
1451 } | 1451 } |
1452 | 1452 |
1453 if (m_manager && m_manager->haveInProgressSelection()) { | 1453 if (m_manager && m_manager->haveInProgressSelection()) { |
1454 | 1454 |
1455 //cerr << "JTEST: release with selection" << endl; | |
1455 bool exclusive; | 1456 bool exclusive; |
1456 Selection selection = m_manager->getInProgressSelection(exclusive); | 1457 Selection selection = m_manager->getInProgressSelection(exclusive); |
1457 | 1458 |
1458 if (selection.getEndFrame() < selection.getStartFrame() + 2) { | 1459 if (selection.getEndFrame() < selection.getStartFrame() + 2) { |
1459 selection = Selection(); | 1460 selection = Selection(); |
1464 if (exclusive) { | 1465 if (exclusive) { |
1465 m_manager->setSelection(selection); | 1466 m_manager->setSelection(selection); |
1466 } else { | 1467 } else { |
1467 m_manager->addSelection(selection); | 1468 m_manager->addSelection(selection); |
1468 } | 1469 } |
1470 } | |
1471 else if (m_manager && !m_manager->haveInProgressSelection()) { | |
1472 | |
1473 //cerr << "JTEST: release without selection" << endl; | |
1474 // Get frame locatrion of mouse | |
1475 int mouseFrame = getFrameForX(e->x()); | |
1476 //cerr << "JTEST: frame location of click is " << mouseFrame << endl; | |
1477 // Move play head to that frame location | |
1478 int playbackFrame = fmax(0,mouseFrame); | |
1479 m_manager->setPlaybackFrame(playbackFrame); | |
1469 } | 1480 } |
1470 | 1481 |
1471 update(); | 1482 update(); |
1472 | 1483 |
1473 } else if (mode == ViewManager::DrawMode) { | 1484 } else if (mode == ViewManager::DrawMode) { |