diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-01-25 13:35:08 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-01-25 13:35:08 +0000 |
| commit | 3b35e676c9107f8627587365f6e01ebf0093e9c5 (patch) | |
| tree | 8e5d306024820cf9b2adf2e5b4d4735959c8803e /src/knotholder.cpp | |
| parent | removing void files (diff) | |
| download | inkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.tar.gz inkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.zip | |
- The snap-delay mechanism should now be more robust. From now on, it must be turned on and off explicitely within each context. This prevents delayed snapping events from being fired after the context or context's state has changed.
- Creating single dots now snaps
(bzr r7172)
Diffstat (limited to 'src/knotholder.cpp')
| -rw-r--r-- | src/knotholder.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 0cb9fc423..eaf5658f8 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -30,6 +30,8 @@ #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 @@ -53,6 +55,8 @@ KnotHolder::KnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderReleasedFun this->repr = repr; this->local_change = FALSE; + + this->dragging = false; } KnotHolder::~KnotHolder() { @@ -89,7 +93,7 @@ KnotHolder::update_knots() 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; @@ -133,7 +137,12 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state) 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; |
