mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Better managing of vertex selection
This commit is contained in:
+10
-2
@@ -22,7 +22,7 @@
|
||||
#include "MainWindow.h"
|
||||
|
||||
MapperGLCanvas::MapperGLCanvas(QWidget* parent, const QGLWidget * shareWidget)
|
||||
: QGLWidget(parent, shareWidget), _mousepressed(false), _active_vertex(0)
|
||||
: QGLWidget(parent, shareWidget), _mousepressed(false), _active_vertex(NO_VERTEX)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ void MapperGLCanvas::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
// std::cout << "Move event " << std::endl;
|
||||
Shape* shape = getCurrentShape();
|
||||
if (shape)
|
||||
if (shape && _active_vertex != NO_VERTEX)
|
||||
{
|
||||
Point p = shape->getVertex(_active_vertex);
|
||||
p.x = event->x();
|
||||
@@ -287,3 +287,11 @@ void MapperGLCanvas::glueVertex(Shape *orig, Point *p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MapperGLCanvas::deselectAll()
|
||||
{
|
||||
_active_vertex = NO_VERTEX;
|
||||
_shapegrabbed = false;
|
||||
_shapefirstgrab = false;
|
||||
_mousepressed = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user