diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index 0cb9fc423e410469a33994f2364ba0d5a17391ec..eaf5658f803dc5cb3db25637b366875dfece1846 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
#include "sp-pattern.h"
#include "style.h"
#include "live_effects/lpeobject.h"
+#include "desktop.h"
+#include "display/sp-canvas.h"
#include "xml/repr.h" // for debugging only
this->repr = repr;
this->local_change = FALSE;
+
+ this->dragging = false;
}
KnotHolder::~KnotHolder() {
void
KnotHolder::knot_clicked_handler(SPKnot *knot, guint state)
{
- KnotHolder *knot_holder = this;
+ KnotHolder *knot_holder = this;
for(std::list<KnotHolderEntity *>::iterator i = knot_holder->entity.begin(); i != knot_holder->entity.end(); ++i) {
KnotHolderEntity *e = *i;
void
KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state)
{
- // this was a local change and the knotholder does not need to be recreated:
+ if (this->dragging == false) {
+ this->dragging = true;
+ sp_canvas_set_snap_delay_active(desktop->canvas, true);
+ }
+
+ // this was a local change and the knotholder does not need to be recreated:
this->local_change = TRUE;
for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
@@ -155,7 +164,10 @@ KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state)
void
KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/)
{
- if (this->released) {
+ this->dragging = false;
+ sp_canvas_set_snap_delay_active(desktop->canvas, false);
+
+ if (this->released) {
this->released(this->item);
} else {
SPObject *object = (SPObject *) this->item;