diff options
| author | Jabiertxof <jtx@jtx> | 2017-02-06 23:25:47 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2017-02-06 23:25:47 +0000 |
| commit | 7d0612fd5d4791988e0c0e05a2cbf1fba84fd655 (patch) | |
| tree | bd36ab893cc0e173eb61da80e27b7cc910838343 /src | |
| parent | Remove some unneeded < C++11 fallback code (diff) | |
| download | inkscape-7d0612fd5d4791988e0c0e05a2cbf1fba84fd655.tar.gz inkscape-7d0612fd5d4791988e0c0e05a2cbf1fba84fd655.zip | |
This commit fixes bug #1657874
Title Missing handles after reset of rotation center
Whats the bug: In a previous commit I do, I change a event on knots from onmove to onmousedown. this seems ok but the problem were if the user click on rotation center without moving it, the onrelease event has a variable move not set and hide the current knots making the needs to switch the tools to reshow. Is in particular a big problem on little elements where the center knot have a big influence and is very easy to click on it on select.
Why do this commit that broke: I want have onmousedown fired to allow meshgradient triangle knots updated on mouse down.
What fixes: INstras change the place of the signal, I send back to the original position and create a new signal to fire onmousedow a knot. In the gradient code I change the previous calls from undrag to onmousedown.
Fixed bugs:
- https://launchpad.net/bugs/1657874
(bzr r15486)
Diffstat (limited to 'src')
| -rw-r--r-- | src/gradient-drag.cpp | 6 | ||||
| -rw-r--r-- | src/gradient-drag.h | 2 | ||||
| -rw-r--r-- | src/knot.cpp | 4 | ||||
| -rw-r--r-- | src/knot.h | 1 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index a928cac0d..006e2f790 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1067,7 +1067,7 @@ static void gr_knot_moved_midpoint_handler(SPKnot */*knot*/, Geom::Point const & -static void gr_knot_grabbed_handler(SPKnot */*knot*/, unsigned int /*state*/, gpointer data) +static void gr_knot_mousedown_handler(SPKnot */*knot*/, unsigned int /*state*/, gpointer data) { GrDragger *dragger = (GrDragger *) data; GrDrag *drag = dragger->parent; @@ -1688,7 +1688,7 @@ GrDragger::GrDragger(GrDrag *parent, Geom::Point p, GrDraggable *draggable) this->sizeUpdatedConn = ControlManager::getManager().connectCtrlSizeChanged(sigc::mem_fun(*this, &GrDragger::updateControlSizes)); this->_clicked_connection = this->knot->click_signal.connect(sigc::bind(sigc::ptr_fun(gr_knot_clicked_handler), this)); this->_doubleclicked_connection = this->knot->doubleclicked_signal.connect(sigc::bind(sigc::ptr_fun(gr_knot_doubleclicked_handler), this)); - this->_grabbed_connection = this->knot->grabbed_signal.connect(sigc::bind(sigc::ptr_fun(gr_knot_grabbed_handler), this)); + this->_mousedown_connection = this->knot->mousedown_signal.connect(sigc::bind(sigc::ptr_fun(gr_knot_mousedown_handler), this)); this->_ungrabbed_connection = this->knot->ungrabbed_signal.connect(sigc::bind(sigc::ptr_fun(gr_knot_ungrabbed_handler), this)); // add the initial draggable @@ -1712,7 +1712,7 @@ GrDragger::~GrDragger() this->_moved_connection.disconnect(); this->_clicked_connection.disconnect(); this->_doubleclicked_connection.disconnect(); - this->_grabbed_connection.disconnect(); + this->_mousedown_connection.disconnect(); this->_ungrabbed_connection.disconnect(); /* unref should call destroy */ diff --git a/src/gradient-drag.h b/src/gradient-drag.h index b4a64c78d..1fe2fb3f0 100644 --- a/src/gradient-drag.h +++ b/src/gradient-drag.h @@ -130,7 +130,7 @@ private: sigc::connection _moved_connection; sigc::connection _clicked_connection; sigc::connection _doubleclicked_connection; - sigc::connection _grabbed_connection; + sigc::connection _mousedown_connection; sigc::connection _ungrabbed_connection; }; diff --git a/src/knot.cpp b/src/knot.cpp index c04206dee..50fa73391 100644 --- a/src/knot.cpp +++ b/src/knot.cpp @@ -214,7 +214,7 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot if ((event->button.button == 1) && knot->desktop && knot->desktop->event_context && !knot->desktop->event_context->space_panning) { Geom::Point const p = knot->desktop->w2d(Geom::Point(event->button.x, event->button.y)); knot->startDragging(p, (gint) event->button.x, (gint) event->button.y, event->button.time); - knot->grabbed_signal.emit(knot, event->button.state); + knot->mousedown_signal.emit(knot, event->button.state); consumed = TRUE; } break; @@ -241,7 +241,6 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot if (moved) { knot->setFlag(SP_KNOT_DRAGGING, FALSE); - knot->ungrabbed_signal.emit(knot, event->button.state); } else { knot->click_signal.emit(knot, event->button.state); @@ -277,6 +276,7 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot if (!moved) { knot->setFlag(SP_KNOT_DRAGGING, TRUE); + knot->grabbed_signal.emit(knot, event->button.state); } sp_event_context_snap_delay_handler(knot->desktop->event_context, NULL, knot, (GdkEventMotion *)event, Inkscape::UI::Tools::DelayedSnapEvent::KNOT_HANDLER); diff --git a/src/knot.h b/src/knot.h index 954ddd8a6..0a0ce73d2 100644 --- a/src/knot.h +++ b/src/knot.h @@ -79,6 +79,7 @@ public: // be able to figure that out sigc::signal<void, SPKnot *, unsigned int> click_signal; sigc::signal<void, SPKnot*, unsigned int> doubleclicked_signal; + sigc::signal<void, SPKnot*, unsigned int> mousedown_signal; sigc::signal<void, SPKnot*, unsigned int> grabbed_signal; sigc::signal<void, SPKnot *, unsigned int> ungrabbed_signal; sigc::signal<void, SPKnot *, Geom::Point const &, unsigned int> moved_signal; |
