Git commit d56f0037081871ccc8596819dd3302c101f04503 by Steve Allewell. Committed on 31/05/2014 at 21:21. Pushed by sallewell into branch 'master'. Fix picking of existing nodes when snap enabled When snap mode is enabled, existing nodes that were not close to a snap point were not selectable for moving because the points being compared were converted to a snap point before comparison. M +12 -12 src/Editor.cpp http://commits.kde.org/symboleditor/d56f0037081871ccc8596819dd3302c101f04503 diff --git a/src/Editor.cpp b/src/Editor.cpp index c507e65..94aeb60 100644 --- a/src/Editor.cpp +++ b/src/Editor.cpp @@ -789,17 +789,17 @@ void Editor::readSettings() */ void Editor::mousePressEvent(QMouseEvent *event) { - QPointF p =3D snapPoint(event->pos()); + QPoint p =3D event->pos(); = if (event->buttons() & Qt::LeftButton) { - m_start =3D m_tracking =3D p; + m_start =3D m_tracking =3D snapPoint(p); m_rubberBand =3D QRectF(); = - if (node(p)) { + if (node(toSymbol(p))) { m_dragging =3D true; - m_dragPointIndex =3D nodeUnderCursor(p); + m_dragPointIndex =3D nodeUnderCursor(toSymbol(p)); } else { - addPoint(p); + addPoint(m_start); } } = @@ -830,18 +830,18 @@ void Editor::mouseMoveEvent(QMouseEvent *event) update(); } = - QPointF p =3D snapPoint(event->pos()); + QPoint p =3D event->pos(); = if (event->buttons() & Qt::LeftButton) { - if (m_tracking !=3D p) { - m_tracking =3D p; + if (m_tracking !=3D snapPoint(p)) { + m_tracking =3D snapPoint(p); = if (m_dragging) { if (m_dragPointIndex.first) { - m_points[m_dragPointIndex.second] =3D p; + m_points[m_dragPointIndex.second] =3D m_tracking; constructPainterPath(); } else { - m_activePoints[m_dragPointIndex.second] =3D p; + m_activePoints[m_dragPointIndex.second] =3D m_tracking; } } else if (m_toolMode =3D=3D Rectangle || m_toolMode =3D=3D El= lipse) { m_rubberBand =3D QRectF(m_start, m_tracking).normalized(); @@ -850,14 +850,14 @@ void Editor::mouseMoveEvent(QMouseEvent *event) update(); } } else { - if (node(p)) { + if (node(toSymbol(p))) { setCursor(Qt::SizeAllCursor); } else { setCursor(Qt::ArrowCursor); } } = - if (constructGuides(p)) { + if (constructGuides(toSymbol(p))) { update(); } }