diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-07-04 21:41:25 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-07-04 21:41:25 +0000 |
| commit | 1d2fa48c9a62c4929264cf5b59907f8d4f0e55b5 (patch) | |
| tree | 1c61f6d9affb0953e1d528704be7333d427fb516 /src/knotholder.cpp | |
| parent | More icons clean-up. (diff) | |
| download | inkscape-1d2fa48c9a62c4929264cf5b59907f8d4f0e55b5.tar.gz inkscape-1d2fa48c9a62c4929264cf5b59907f8d4f0e55b5.zip | |
Fix a bug with select knots and modifiers
Diffstat (limited to 'src/knotholder.cpp')
| -rw-r--r-- | src/knotholder.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 6ff914733..29054bcd9 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -226,23 +226,13 @@ 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: this->local_change = TRUE; - if (!(state & GDK_SHIFT_MASK)) { - unselect_knots(); - } + for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) { KnotHolderEntity *e = *i; - if (!(state & GDK_SHIFT_MASK)) { - e->knot->selectKnot(false); - } if (e->knot == knot) { Geom::Point const q = p * item->i2dt_affine().inverse(); e->knot_set(q, e->knot->drag_origin * item->i2dt_affine().inverse(), state); - e->knot_click(state); - if (!(e->knot->flags & SP_KNOT_SELECTED) || !(state & GDK_SHIFT_MASK)){ - e->knot->selectKnot(true); - } else { - e->knot->selectKnot(false); - } + break; } } @@ -255,13 +245,30 @@ KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state) } void -KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/, guint) +KnotHolder::knot_ungrabbed_handler(SPKnot *knot, guint state) { - this->dragging = false; + this->dragging = false; - if (this->released) { + if (this->released) { this->released(this->item); } else { + if (!(state & GDK_SHIFT_MASK)) { + unselect_knots(); + } + for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) { + KnotHolderEntity *e = *i; + if (!(state & GDK_SHIFT_MASK)) { + e->knot->selectKnot(false); + } + if (e->knot == knot) { + // no need to test whether knot_click exists since it's virtual now + if (!(e->knot->flags & SP_KNOT_SELECTED) || !(state & GDK_SHIFT_MASK)){ + e->knot->selectKnot(true); + } else { + e->knot->selectKnot(false); + } + } + } SPObject *object = (SPObject *) this->item; // Caution: this call involves a screen update, which may process events, and as a @@ -307,7 +314,6 @@ KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/, guint) } } } - DocumentUndo::done(object->document, object_verb, _("Move handle")); } } |
