From efcaaaf38289ebf771c0b8a0cec29a5976164f45 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 6 Aug 2014 15:27:37 -0400 Subject: Fix mistake introduced in r13495 (bzr r13498) --- src/sp-star.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 712029468..a9bb946c2 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -516,7 +516,6 @@ void SPStar::snappoints(std::vector &p, Inkscape:: Geom::Affine SPStar::set_transform(Geom::Affine const &tform) { Geom::Affine xform = (randomized == 0 ? tform.withoutTranslation() : tform); - // Only set transform with proportional scaling if (!xform.isUniformScale()) { return xform; @@ -528,7 +527,7 @@ Geom::Affine SPStar::set_transform(Geom::Affine const &tform) } /* Calculate star start in parent coords. */ - Geom::Point pos( this->center * xform ); + Geom::Point pos( this->center * tform ); /* This function takes care of translation and scaling, we return whatever parts we can't handle. */ -- cgit v1.2.3 From 0fea5bc6928fcd9b6b7ccc3434d4a7b3147c775f Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 6 Aug 2014 15:36:33 -0400 Subject: Fix another mistake introduced in r13495 (bzr r13499) --- src/sp-star.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index a9bb946c2..a43d681ce 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -513,9 +513,8 @@ void SPStar::snappoints(std::vector &p, Inkscape:: } } -Geom::Affine SPStar::set_transform(Geom::Affine const &tform) +Geom::Affine SPStar::set_transform(Geom::Affine const &xform) { - Geom::Affine xform = (randomized == 0 ? tform.withoutTranslation() : tform); // Only set transform with proportional scaling if (!xform.isUniformScale()) { return xform; @@ -527,7 +526,7 @@ Geom::Affine SPStar::set_transform(Geom::Affine const &tform) } /* Calculate star start in parent coords. */ - Geom::Point pos( this->center * tform ); + Geom::Point pos( this->center * xform ); /* This function takes care of translation and scaling, we return whatever parts we can't handle. */ -- cgit v1.2.3 From 7a0d091a5e5599ceff0eb4c20f7b6e818057e5c1 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 6 Aug 2014 21:45:33 -0400 Subject: Redo the fix for bug #1348375 (bzr r13500) --- src/sp-star.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sp-star.cpp b/src/sp-star.cpp index a43d681ce..97a690520 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -515,8 +515,9 @@ void SPStar::snappoints(std::vector &p, Inkscape:: Geom::Affine SPStar::set_transform(Geom::Affine const &xform) { + bool opt_trans = (randomized == 0); // Only set transform with proportional scaling - if (!xform.isUniformScale()) { + if (!xform.withoutTranslation().isUniformScale()) { return xform; } @@ -530,7 +531,7 @@ Geom::Affine SPStar::set_transform(Geom::Affine const &xform) /* This function takes care of translation and scaling, we return whatever parts we can't handle. */ - Geom::Affine ret(xform); + Geom::Affine ret(opt_trans ? xform.withoutTranslation() : xform); gdouble const s = hypot(ret[0], ret[1]); if (s > 1e-9) { ret[0] /= s; -- cgit v1.2.3 From 10f3e62a490f3942c0f5be3947d99c4a4f41ea1e Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Thu, 7 Aug 2014 08:06:10 +0200 Subject: Connectors. Fix for Bug #1155046 (Assertion pathlen < 200 failed). Fixed bugs: - https://launchpad.net/bugs/1155046 (bzr r13501) --- src/libavoid/connector.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp index b8c99a48c..40ded7498 100644 --- a/src/libavoid/connector.cpp +++ b/src/libavoid/connector.cpp @@ -845,7 +845,10 @@ bool ConnRef::generatePath(void) break; } // Check we don't have an apparent infinite connector path. - COLA_ASSERT(pathlen < 200); +//#ifdef PATHDEBUG + db_printf("Path length: %i\n", pathlen); +//#endif + COLA_ASSERT(pathlen < 10000); } std::vector path(pathlen); -- cgit v1.2.3 From 5a4eae28b6bd036a3ba87fdf90f8560cc1ca5c41 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Thu, 7 Aug 2014 13:43:16 -0400 Subject: refresh clip path when editing in XML editor (Bug 1349018) Fixed bugs: - https://launchpad.net/bugs/1349018 (bzr r13502) --- src/ui/dialog/xml-tree.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 55d0aff09..c87e42633 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -1033,6 +1033,7 @@ void XmlTree::cmd_set_attr() updated->updateRepr(); } + reinterpret_cast(current_desktop->currentLayer())->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); DocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR, _("Change attribute")); -- cgit v1.2.3 From 6db5e5df6f051c44e3f0e7dcadd1587a0b7227f1 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sat, 9 Aug 2014 14:46:44 -0400 Subject: Fix related to bug #1327267 -- don't bother to update gradient toolbar when not in gradient tool (bzr r13504) --- src/widgets/gradient-toolbar.cpp | 75 ++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index 4fda44c8d..f5a99f3e7 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -448,11 +448,6 @@ static void gr_defs_modified(SPObject * /*defs*/, guint /*flags*/, GtkWidget *wi gr_tb_selection_changed(NULL, (gpointer) widget); } -static void gr_disconnect_sigc(GObject * /*obj*/, sigc::connection *connection) { - connection->disconnect(); - delete connection; -} - static SPStop *get_selected_stop( GtkWidget *vb) { SPStop *stop = NULL; @@ -1018,6 +1013,9 @@ void check_renderer(GtkWidget *combo) g_object_set_data(G_OBJECT(combo), "renderers", renderer); } } + +static void gradient_toolbox_check_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder); + /** * Gradient auxiliary toolbar construction and setup. * @@ -1229,34 +1227,51 @@ void sp_gradient_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(itact), !linkedmode ); } - Inkscape::Selection *selection = sp_desktop_selection(desktop); - SPDocument *document = sp_desktop_document(desktop); - g_object_set_data(holder, "desktop", desktop); - // connect to selection modified and changed signals - sigc::connection *conn1 = new sigc::connection( - selection->connectChanged(sigc::bind(sigc::ptr_fun(&gr_tb_selection_changed), (gpointer) holder))); - sigc::connection *conn2 = new sigc::connection( - selection->connectModified(sigc::bind(sigc::ptr_fun(&gr_tb_selection_modified), (gpointer) holder))); - sigc::connection *conn3 = new sigc::connection( - desktop->connectToolSubselectionChanged( sigc::bind(sigc::ptr_fun(&gr_drag_selection_changed), (gpointer) holder))); - - // when holder is destroyed, disconnect - g_signal_connect(G_OBJECT(holder), "destroy", G_CALLBACK(gr_disconnect_sigc), conn1); - g_signal_connect(G_OBJECT(holder), "destroy", G_CALLBACK(gr_disconnect_sigc), conn2); - g_signal_connect(G_OBJECT(holder), "destroy", G_CALLBACK(gr_disconnect_sigc), conn3); - - // connect to release and modified signals of the defs (i.e. when someone changes gradient) - sigc::connection *release_connection = new sigc::connection(); - *release_connection = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&gr_defs_release), GTK_WIDGET(holder))); - sigc::connection *modified_connection = new sigc::connection(); - *modified_connection = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&gr_defs_modified), GTK_WIDGET(holder))); - - // when holder is destroyed, disconnect - g_signal_connect(G_OBJECT(holder), "destroy", G_CALLBACK(gr_disconnect_sigc), release_connection); - g_signal_connect(G_OBJECT(holder), "destroy", G_CALLBACK(gr_disconnect_sigc), modified_connection); + desktop->connectEventContextChanged(sigc::bind(sigc::ptr_fun(&gradient_toolbox_check_ec), holder)); +} + +// lp:1327267 +/** + * Checks the current tool and connects gradient aux toolbox signals if it happens to be the gradient tool. + * Called every time the current tool changes by signal emission. + */ +static void gradient_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder) +{ + static sigc::connection connChanged; + static sigc::connection connModified; + static sigc::connection connSubselectionChanged; + static sigc::connection connDefsRelease; + static sigc::connection connDefsModified; + + if (SP_IS_GRADIENT_CONTEXT(ec)) { + Inkscape::Selection *selection = sp_desktop_selection(desktop); + SPDocument *document = sp_desktop_document(desktop); + // connect to selection modified and changed signals + connChanged = selection->connectChanged(sigc::bind(sigc::ptr_fun(&gr_tb_selection_changed), holder)); + connModified = selection->connectModified(sigc::bind(sigc::ptr_fun(&gr_tb_selection_modified), holder)); + connSubselectionChanged = desktop->connectToolSubselectionChanged(sigc::bind(sigc::ptr_fun(&gr_drag_selection_changed), holder)); + + // Is this necessary? Couldn't hurt. + gr_tb_selection_changed(selection, holder); + + // connect to release and modified signals of the defs (i.e. when someone changes gradient) + connDefsRelease = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&gr_defs_release), GTK_WIDGET(holder))); + connDefsModified = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&gr_defs_modified), GTK_WIDGET(holder))); + } else { + if (connChanged) + connChanged.disconnect(); + if (connModified) + connModified.disconnect(); + if (connSubselectionChanged) + connSubselectionChanged.disconnect(); + if (connDefsRelease) + connDefsRelease.disconnect(); + if (connDefsModified) + connDefsModified.disconnect(); + } } /* -- cgit v1.2.3