MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / mouseMoveEvent

Method mouseMoveEvent

Gui/DopeSheetView.cpp:3538–3582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3536} // DopeSheetView::mousePressEvent
3537
3538void
3539DopeSheetView::mouseMoveEvent(QMouseEvent *e)
3540{
3541 running_in_main_thread();
3542
3543 QPointF mouseZoomCoords = _imp->zoomContext.toZoomCoordinates( e->x(), e->y() );
3544
3545 if (e->buttons() == Qt::NoButton) {
3546 setCursor( _imp->getCursorDuringHover( e->pos() ) );
3547 } else if (_imp->eventState == DopeSheetView::esZoomingView) {
3548 _imp->zoomOrPannedSinceLastFit = true;
3549
3550 int deltaX = 2 * ( e->x() - _imp->lastPosOnMouseMove.x() );
3551 double scaleFactorX = std::pow( NATRON_WHEEL_ZOOM_PER_DELTA, deltaX);
3552 QPointF zoomCenter = _imp->zoomContext.toZoomCoordinates( _imp->lastPosOnMousePress.x(),
3553 _imp->lastPosOnMousePress.y() );
3554
3555 // Alt + Wheel: zoom time only, keep point under mouse
3556 _imp->zoomContext.zoomx(zoomCenter.x(), zoomCenter.y(), scaleFactorX);
3557
3558 redraw();
3559
3560 // Synchronize the dope sheet editor and opened viewers
3561 if ( _imp->gui->isTripleSyncEnabled() ) {
3562 _imp->updateCurveWidgetFrameRange();
3563 _imp->gui->centerOpenedViewersOn( _imp->zoomContext.left(), _imp->zoomContext.right() );
3564 }
3565 } else if ( buttonDownIsLeft(e) ) {
3566 _imp->onMouseLeftButtonDrag(e);
3567 } else if ( buttonDownIsMiddle(e) ) {
3568 double dx = _imp->zoomContext.toZoomCoordinates( _imp->lastPosOnMouseMove.x(),
3569 _imp->lastPosOnMouseMove.y() ).x() - mouseZoomCoords.x();
3570 _imp->zoomContext.translate(dx, 0);
3571
3572 redraw();
3573
3574 // Synchronize the curve editor and opened viewers
3575 if ( _imp->gui->isTripleSyncEnabled() ) {
3576 _imp->updateCurveWidgetFrameRange();
3577 _imp->gui->centerOpenedViewersOn( _imp->zoomContext.left(), _imp->zoomContext.right() );
3578 }
3579 }
3580
3581 _imp->lastPosOnMouseMove = e->pos();
3582} // DopeSheetView::mouseMoveEvent
3583
3584void
3585DopeSheetView::mouseReleaseEvent(QMouseEvent *e)

Callers

nothing calls this directly

Calls 13

running_in_main_threadFunction · 0.85
getCursorDuringHoverMethod · 0.80
isTripleSyncEnabledMethod · 0.80
centerOpenedViewersOnMethod · 0.80
onMouseLeftButtonDragMethod · 0.80
powFunction · 0.50
toZoomCoordinatesMethod · 0.45
xMethod · 0.45
yMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected