summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
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 /src/selection-chemistry.cpp
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)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp19
1 files changed, 18 insertions, 1 deletions
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);