keyframeview: correctly map bezier control positions when signalling scroll

Fixes #1704
This commit is contained in:
itsmattkc
2021-08-14 12:45:46 -07:00
parent 3c7c0c8f9d
commit 98044e0be1
+4 -1
View File
@@ -279,7 +279,10 @@ void KeyframeViewBase::mouseMoveEvent(QMouseEvent *event)
dragging_bezier_point_->key()->set_bezier_control(opposing_type,
new_opposing_pos);
emit Dragged(qRound(dragging_bezier_point_->x()), qRound(dragging_bezier_point_->y()));
// Bezier control points are parented to keyframe items making their positions relative
// to those items. We need to map them to the scene coordinates for this to work properly.
QPointF bezier_pos = dragging_bezier_point_->pos() + dragging_bezier_point_->parentItem()->pos();
emit Dragged(qRound(bezier_pos.x()), qRound(bezier_pos.y()));
} else if (!selected_keys_.isEmpty()) {