From 3ad20ddd9b3a3363295abd2c4823331dc3846d25 Mon Sep 17 00:00:00 2001 From: Tats Date: Fri, 2 May 2014 14:13:40 -0400 Subject: [PATCH] Changed the stick vertex comparison code to work with the new distance methods --- MapperGLCanvas.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MapperGLCanvas.cpp b/MapperGLCanvas.cpp index 8b32c5d..b058dba 100644 --- a/MapperGLCanvas.cpp +++ b/MapperGLCanvas.cpp @@ -249,7 +249,6 @@ void MapperGLCanvas::enableDisplayControls(bool display) void MapperGLCanvas::glueVertex(Shape *orig, QPointF *p) { MappingManager manager = getMainWindow()->getMappingManager(); - int dist_stick = 10; /*this parameter may*/ for (int i = 0; i < manager.nMappings(); i++) { Shape *shape = getShapeFromMappingId(manager.getMapping(i)->getId()); @@ -258,8 +257,7 @@ void MapperGLCanvas::glueVertex(Shape *orig, QPointF *p) for (int vertex = 0; vertex < shape->nVertices(); vertex++) { const QPointF& v = shape->getVertex(vertex); - if ((qAbs(v.x() - p->x()) < dist_stick) && - (qAbs(v.y() - p->y()) < dist_stick)) + if (distIsInside(v, *p, MM::VERTEX_STICK_RADIUS)) { p->setX(v.x()); p->setY(v.y());