- m_spline.setPoint(m_currentPointIndex, point);
-
- /*if (removePoint && d->m_curve.points().count() > 2) {
- d->m_draggedAwayPoint = d->m_curve.points()[d->m_grab_point_index];
- d->m_draggedAwayPointIndex = d->m_grab_point_index;
- d->m_curve.removePoint(d->m_grab_point_index);
- d->m_grab_point_index = bounds(d->m_grab_point_index, 0, d->m_curve.points().count() - 1);
+ int index = m_currentPointIndex;
+ m_currentPointIndex = m_spline.setPoint(m_currentPointIndex, point);
+
+ if (m_currentPointType == PTypeP) {
+ // we might have changed the handles of other points
+ // try to restore
+ if (index == m_currentPointIndex) {
+ if (m_currentPointIndex > 0)
+ m_spline.setPoint(m_currentPointIndex - 1, m_grabPPrevious);
+ if (m_currentPointIndex < m_spline.points().count() -1)
+ m_spline.setPoint(m_currentPointIndex + 1, m_grabPNext);
+ } else {
+ if (m_currentPointIndex < index) {
+ m_spline.setPoint(index, m_grabPPrevious);
+ m_grabPNext = m_grabPPrevious;
+ if (m_currentPointIndex > 0)
+ m_grabPPrevious = m_spline.points()[m_currentPointIndex - 1];
+ } else {
+ m_spline.setPoint(index, m_grabPNext);
+ m_grabPPrevious = m_grabPNext;
+ if (m_currentPointIndex < m_spline.points().count() - 1)
+ m_grabPNext = m_spline.points()[m_currentPointIndex + 1];
+ }
+ }