summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-01-07 22:34:17 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-01-07 22:34:17 +0000
commit2ee40bd9c163b28d693545abca50ca94567338b0 (patch)
tree640d0c6998ec730d42f10f473a0a608dcdbdeeae /src
parentReverting revision 13615 (diff)
downloadinkscape-2ee40bd9c163b28d693545abca50ca94567338b0.tar.gz
inkscape-2ee40bd9c163b28d693545abca50ca94567338b0.zip
force full redraw every 5 interruptions when dragging knots; disconnect knot signals when destroying dragger
(bzr r2151)
Diffstat (limited to 'src')
-rw-r--r--src/gradient-drag.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 465f57b86..3c3563d8d 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -492,6 +492,14 @@ gr_knot_moved_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpoi
dragger->updateDependencies(false);
}
+static void
+gr_knot_grabbed_handler (SPKnot *knot, unsigned int state, gpointer data)
+{
+ GrDragger *dragger = (GrDragger *) data;
+
+ sp_canvas_force_full_redraw_after_interruptions(dragger->parent->desktop->canvas, 5);
+}
+
/**
Called when the mouse releases a dragger knot; changes gradient writing to repr, updates other draggers if needed
*/
@@ -500,6 +508,8 @@ gr_knot_ungrabbed_handler (SPKnot *knot, unsigned int state, gpointer data)
{
GrDragger *dragger = (GrDragger *) data;
+ sp_canvas_end_forced_full_redraws(dragger->parent->desktop->canvas);
+
dragger->point_original = dragger->point = knot->pos;
if ((state & GDK_CONTROL_MASK) && (state & GDK_SHIFT_MASK)) {
@@ -780,6 +790,7 @@ GrDragger::GrDragger (GrDrag *parent, NR::Point p, GrDraggable *draggable)
this->handler_id = g_signal_connect (G_OBJECT (this->knot), "moved", G_CALLBACK (gr_knot_moved_handler), this);
g_signal_connect (G_OBJECT (this->knot), "clicked", G_CALLBACK (gr_knot_clicked_handler), this);
g_signal_connect (G_OBJECT (this->knot), "doubleclicked", G_CALLBACK (gr_knot_doubleclicked_handler), this);
+ g_signal_connect (G_OBJECT (this->knot), "grabbed", G_CALLBACK (gr_knot_grabbed_handler), this);
g_signal_connect (G_OBJECT (this->knot), "ungrabbed", G_CALLBACK (gr_knot_ungrabbed_handler), this);
// add the initial draggable
@@ -794,6 +805,13 @@ GrDragger::~GrDragger ()
if (this->parent->selected == this)
this->parent->setSelected (NULL);
+ // disconnect signals
+ g_signal_handlers_disconnect_by_func(G_OBJECT(this->knot), (gpointer) G_CALLBACK (gr_knot_moved_handler), this);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(this->knot), (gpointer) G_CALLBACK (gr_knot_clicked_handler), this);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(this->knot), (gpointer) G_CALLBACK (gr_knot_doubleclicked_handler), this);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(this->knot), (gpointer) G_CALLBACK (gr_knot_grabbed_handler), this);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(this->knot), (gpointer) G_CALLBACK (gr_knot_ungrabbed_handler), this);
+
/* unref should call destroy */
g_object_unref (G_OBJECT (this->knot));