Skip to content

Commit

Permalink
VectorGraphView_improved_point_curve_editing
Browse files Browse the repository at this point in the history
  • Loading branch information
szeli1 committed Jun 30, 2024
1 parent d2bcdc7 commit 0a3101f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/widgets/VectorGraphView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ void VectorGraphView::mouseMoveEvent(QMouseEvent* me)
else if (model()->getDataArray(m_selectedArray)->getIsEditableAttrib() == true)
{
#ifdef VECTORGRAPH_DEBUG_USER_INTERACTION
qDebug("mouseMoveEvent curve drag");
qDebug("mouseMoveEvent curve drag: mouse (x, y): (%d, %d), last track point (x, y): (%d, %d)", x, (m_graphHeight - y), m_lastTrackPoint.first, m_lastTrackPoint.second);
#endif
// dragging curve
PointF convertedCoords = mapMousePos(x - m_lastTrackPoint.first, m_graphHeight - y + m_lastTrackPoint.second);
PointF convertedCoords = mapMousePos(x - m_lastTrackPoint.first, (m_graphHeight - y) - m_lastTrackPoint.second + m_graphHeight / 2);
float curveValue = convertedCoords.second + convertedCoords.first * 0.1f;
curveValue = std::clamp(curveValue, -1.0f, 1.0f);
model()->getDataArray(m_selectedArray)->setC(m_selectedLocation, curveValue);
Expand Down

0 comments on commit 0a3101f

Please sign in to comment.