From: joncruz Date: Sun, 22 Apr 2007 05:25:43 +0000 (+0000) Subject: Supress initial change due to feedback loop X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=229424228e9c6cf97ab15478acfb3f257698084a;p=inkscape.git Supress initial change due to feedback loop --- diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index b0ff7064b..6d486b902 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4045,11 +4045,21 @@ static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl) return; } + Inkscape::XML::Node *repr = SP_OBJECT_REPR(desktop->namedview); + + if ( repr->attribute("inkscape:connector-spacing") ) { + gdouble priorValue = gtk_adjustment_get_value(adj); + sp_repr_get_double( repr, "inkscape:connector-spacing", &priorValue ); + if ( priorValue == gtk_adjustment_get_value(adj) ) { + return; + } + } else if ( adj->value == defaultConnSpacing ) { + return; + } + // in turn, prevent callbacks from responding g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); - Inkscape::XML::Node *repr = SP_OBJECT_REPR(desktop->namedview); - sp_repr_set_css_double(repr, "inkscape:connector-spacing", adj->value); SP_OBJECT(desktop->namedview)->updateRepr(); @@ -4174,7 +4184,7 @@ static void sp_connector_toolbox_prep( SPDesktop *desktop, GtkActionGroup* mainA // Spacing spinbox eact = create_adjustment_action( "ConnectorSpacingAction", _("Spacing:"), _("The amount of space left around objects by auto-routing connectors"), - "tools.connector", "spacing", 10, + "tools.connector", "spacing", defaultConnSpacing, GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "inkscape:connector-spacing", 0, 100, 1.0, 10.0, 0, 0, 0,