From 38f7b6d983480ee1f58d8eb05248c124843dc5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 9 Nov 2023 05:43:27 -0500 Subject: [PATCH] [curve] Fix moving the abscissa of curve points in basic cases --- .../Inspector/CurvePointInspectorWidget.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/score-plugin-automation/Automation/Inspector/CurvePointInspectorWidget.cpp b/src/plugins/score-plugin-automation/Automation/Inspector/CurvePointInspectorWidget.cpp index 14c4a8c51f..0edb82e8d5 100644 --- a/src/plugins/score-plugin-automation/Automation/Inspector/CurvePointInspectorWidget.cpp +++ b/src/plugins/score-plugin-automation/Automation/Inspector/CurvePointInspectorWidget.cpp @@ -73,10 +73,10 @@ PointInspectorWidget::PointInspectorWidget( ; ((QObject*)m_moveState)->setParent(this); m_moveX.setCurveState(m_moveState); - connect( - m_XBox, - static_cast(&QDoubleSpinBox::valueChanged), this, - &PointInspectorWidget::on_pointXChanged); + // connect( + // m_XBox, + // static_cast(&QDoubleSpinBox::valueChanged), this, + // &PointInspectorWidget::on_pointXChanged); connect( m_XBox, &QSpinBox::editingFinished, this, &PointInspectorWidget::on_editXFinished); @@ -121,8 +121,11 @@ PointInspectorWidget::PointInspectorWidget( void PointInspectorWidget::on_pointXChanged(double d) { - // m_dispatcher.submit( - // *safe_cast(m_model.parent()), m_model.id(), pos); + if(!m_model) + return; + Curve::Point pos{m_XBox->value() / m_xFactor, m_model->pos().y()}; + m_dispatcher.submit( + *safe_cast(m_model->parent()), m_model->id(), pos); } void PointInspectorWidget::on_editXFinished() @@ -136,8 +139,8 @@ void PointInspectorWidget::on_editXFinished() return; auto simpleMove = [this] { - on_pointYChanged(m_YBox->value()); - on_editYFinished(); + on_pointXChanged(m_XBox->value()); + on_editXFinished(); }; // Try to handle all the simple cases: @@ -180,6 +183,7 @@ void PointInspectorWidget::on_editXFinished() return simpleMove(); } } + return; m_model = nullptr;