summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-05-12 11:00:20 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-05-12 11:00:20 +0000
commitb6b64cc354f63f339e8d3db994e2848bff3a1e3a (patch)
tree25a0753b198742f9420623f9aa26e01e8a3a283d
parent* src/ui/dialog/inkscape-preferences.cpp, (diff)
downloadinkscape-b6b64cc354f63f339e8d3db994e2848bff3a1e3a.tar.gz
inkscape-b6b64cc354f63f339e8d3db994e2848bff3a1e3a.zip
* src/selection-chemistry.cpp, src/sp-conn-end-pair.cpp:
When moving/transforming connectors, only detach connectors from objects that are not part of the selection. Previously, connectors moved as part of a selection would be detached from all objects. This has been requested several times via email. The change also fixes bug #1383806. (bzr r811)
-rw-r--r--ChangeLog17
-rw-r--r--src/selection-chemistry.cpp19
-rw-r--r--src/sp-conn-end-pair.cpp3
3 files changed, 31 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bb541995..a0afe6c27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,26 @@
2006-05-11 Michael Wybrow <mjwybrow@users.sourceforge.net>
+ * src/selection-chemistry.cpp, src/sp-conn-end-pair.cpp:
+
+ When moving/transforming connectors, only detach connectors
+ from objects that are not part of the selection. Previously,
+ connectors moved as part of a selection would be detached from
+ all objects. This has been requested several times via email.
+ The change also fixes bug #1383806.
+
* src/ui/dialog/inkscape-preferences.cpp,
src/ui/dialog/inkscape-preferences.h, src/connector-context.cpp:
Add a preferences setting to the connector tool for setting
- whether or not connectors attach to text objects. This
+ whether or not connectors attach to text objects. This change
addresses feature request #1434292.
2006-05-09 Carl Hetherington <inkscape@carlh.net>
- * src/nodepath.cpp: fix silly bug with snapping node edits. *
- src/snapper.cpp, src/snapper.h, src/sp-namedview.cpp: re-enable
- link between grid visibility and grid snap.
+ * src/nodepath.cpp: fix silly bug with snapping node edits.
+
+ * src/snapper.cpp, src/snapper.h, src/sp-namedview.cpp:
+ re-enable link between grid visibility and grid snap.
2006-05-08 Michael Wybrow <mjwybrow@users.sourceforge.net>
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 43ff53a7c..1225a66f3 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -39,6 +39,9 @@
#include "sp-flowregion.h"
#include "text-editing.h"
#include "text-context.h"
+#include "connector-context.h"
+#include "sp-path.h"
+#include "sp-conn-end.h"
#include "dropper-context.h"
#include <glibmm/i18n.h>
#include "libnr/nr-matrix-rotate-ops.h"
@@ -1327,7 +1330,21 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, NR::Matrix const
bool transform_textpath_with_path = (SP_IS_TEXT_TEXTPATH(item) && selection->includes( sp_textpath_get_path_item (SP_TEXTPATH(sp_object_first_child(SP_OBJECT(item)))) ));
bool transform_flowtext_with_frame = (SP_IS_FLOWTEXT(item) && selection->includes( SP_FLOWTEXT(item)->get_frame (NULL))); // only the first frame so far
bool transform_offset_with_source = (SP_IS_OFFSET(item) && SP_OFFSET (item)->sourceHref) && selection->includes( sp_offset_get_source (SP_OFFSET(item)) );
-
+
+ // If we're moving a connector, we want to detach it
+ // from shapes that aren't part of the selection, but
+ // leave it attached if they are
+ if (cc_item_is_connector(item)) {
+ SPItem *attItem[2];
+ SP_PATH(item)->connEndPair.getAttachedItems(attItem);
+
+ for (int n = 0; n < 2; ++n) {
+ if (!selection->includes(attItem[n])) {
+ sp_conn_end_detach(item, n);
+ }
+ }
+ }
+
// "clones are unmoved when original is moved" preference
int compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
bool prefs_unmoved = (compensation == SP_CLONE_COMPENSATION_UNMOVED);
diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp
index c4425add6..a1c4697e5 100644
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
@@ -78,9 +78,6 @@ sp_conn_end_pair_build(SPObject *object)
static void
avoid_conn_move(NR::Matrix const *mp, SPItem *moved_item)
{
- // Detach from objects if attached.
- sp_conn_end_detach(moved_item, 0);
- sp_conn_end_detach(moved_item, 1);
// Reroute connector
SPPath *path = SP_PATH(moved_item);
path->connEndPair.makePathInvalid();