mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
New feature: menu option toggle sticky vertices
This commit is contained in:
+9
-2
@@ -29,7 +29,8 @@ MapperGLCanvas::MapperGLCanvas(MainWindow* mainWindow, QWidget* parent, const QG
|
||||
_activeVertex(NO_VERTEX),
|
||||
_shapeGrabbed(false), // comment out?
|
||||
_shapeFirstGrab(false), // comment out?
|
||||
_displayControls(true)
|
||||
_displayControls(true),
|
||||
_stickyVertices(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -156,7 +157,8 @@ void MapperGLCanvas::mouseMoveEvent(QMouseEvent* event)
|
||||
p.setY(event->y());
|
||||
|
||||
// Stick to vertices.
|
||||
glueVertex(shape, &p);
|
||||
if (stickyVertices())
|
||||
glueVertex(shape, &p);
|
||||
shape->setVertex(_activeVertex, p);
|
||||
|
||||
update();
|
||||
@@ -254,6 +256,11 @@ void MapperGLCanvas::enableDisplayControls(bool display)
|
||||
updateCanvas();
|
||||
}
|
||||
|
||||
void MapperGLCanvas::enableStickyVertices(bool value)
|
||||
{
|
||||
_stickyVertices = value;
|
||||
}
|
||||
|
||||
/* Stick vertex p of Shape orig to another Shape's vertex, if the 2 vertices are
|
||||
* close enough. The distance per coordinate is currently set in dist_stick
|
||||
* variable. Perhaps the sticky-sensitivity should be configurable through GUI */
|
||||
|
||||
Reference in New Issue
Block a user