connectors don't respond to group movement

Bug #167168 reported by Bug Importer
62
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Martin Owens

Bug Description

If you use the connector to connect two objects (let's
say shapes), then move one of the object into a group,
the initial connection is broken.

In my opinion, a connector should "connect" objects
using the object ID, and the connection should remain,
even if the objects are in differents groups, layers or
are moved somewhere else.

The connector could be in the layer/group of the first
object (inkscape:connection-start).

Revision history for this message
Peter Moulder (pjrm) wrote :

Actually, if you move the non-grouped object, then the
connector does respond (and re-connects itself to the
grouped object).

Similarly, things work fine if you move the grouped object
independently of its group (e.g. by selecting the object
with Ctrl+click or by entering the group with right-click).

Thus, the problem seems to be that moving the group doesn't
trigger the connector movement.

Revision history for this message
Michael Wybrow (mjwybrow) wrote :

At the moment this is not so easy to fix. Peter is correct,
it happens because a transform signal is emitted for the
group but not for any of the objects in the group, so the
connector code does not know anything has happened.

One solution would be to emit transformed signals for all
the objects in the group. I suspect this would break
assumptions and cause problems elsewhere in the code. For
example, the gradients code (the transform gradients is off)
copes with this in a different way, by calling a recursive
gradient transform function that applies itself to all the
children of an item (i.e., all the objects inside a group).
 We can't easily takes the same approach since objects do
not directly know the objects attached to them since all the
compensation was done through handling of signals.

Perhaps the right thing is to have a false_transform signal
for cases like this that is emitted for every object inside
a group. Gradients and connectors could use this. Also,
this may also be able to be used for clones, since there are
some problems there with transform signals not being
generated for chains of clones also.

This needs some discussion among the developers...

Revision history for this message
Amelve (amelve) wrote :

It seems to be linked to group movement and object
transform, but might be worth mentioning : when scaling (in
my case) the whole drawing, the connectors are broken.

Revision history for this message
Hjp (hjp) wrote :

If an object with the connector-avoid property is moved to
overlap a broken connector, the connector is "repaired" -
i.e., it connected to its endpoints again and routed around
all objects between. So, as a woraround, the user can create
a small object and just drop that on every broken connection.

Which inspires the following idea:
Maybe a quick fix would be to add a "re-route all
connections" button. I realize this has negative
consequences: If you have carefully reshaped your
connections with bezier curves, this will replace them all
with straight lines. But at least all connections will have
the right start- and end-points again. So it might be a
viable band-aid, until the correct solution has been figured
out.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
robocoder (apang) wrote :

Could you implement the Observer pattern, and have the connector listen for the transform signal?

Revision history for this message
Derick Eisenhardt (zephyrxero) wrote :

I'm not familiar with Inkscape's codebase, but couldn't the connector be informed to listen out for group changes if there is a sub-object with a connector attached and update the connector if the group moves? This would be a lot cleaner than to have every object in the group give a movement notification I would think...

Anyway...I'd very much like to see this resolved. It makes making diagrams with groups and connectors involved very cumbersome, and I'd much rather use Inkscape than Dia or something because your interface is just so much nicer and I use it practically everyday ;)

Thanks!

Revision history for this message
rafi (rafi-ugcs) wrote :

What about emitting a "grouped" signal. Then add a stack of objects to watch for to the connector. I'm not sure if internal edits are forbidden, if so then the connector only needs to check against the top of the stack, and suffer no slow down.

jazzynico (jazzynico)
tags: added: groups
removed: all-platforms other
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape 0.48.4.
Not reproduced with trunk revision 12228.

Marking duplicate of Bug #1156977 "Connector doesn't move with objects".

Changed in inkscape:
assignee: Michael Wybrow (mjwybrow) → nobody
milestone: none → 0.49
status: Confirmed → Fix Committed
Revision history for this message
jazzynico (jazzynico) wrote :

Correction: marking Bug #1156977 duplicate this one.

Revision history for this message
jazzynico (jazzynico) wrote :

@Martin - Assigning the report to you because it's probably fixed by your changes in the knot-visio branch. Don't hesitate to revert if it's not the case.

Changed in inkscape:
assignee: nobody → Martin Owens (doctormo)
Revision history for this message
Martin Owens (doctormo) wrote :

Confirmed the bug is no longer a problem in trunk. Thanks for cleaning up the bug.

Revision history for this message
jazzynico (jazzynico) wrote :

Apparently the issue still affects multi-level groups (see follow-up report Bug #1409443 "Connectors broken with two (or more) group levels")

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
Andreas Wehler (andreas-wehler) wrote :

Multi level grouping still does not work as expected.

Ubuntu 14.04; inkscape 0.91 from ppa:
https://launchpad.net/~inkscape.dev/+archive/ubuntu/stable

1) Create connector from object A to object B
2) Create group g1 for objects ( B plus C )
    Test moving group g1: connectors follow, ok.
3) Create group g2 for (g1 plus object D)
  Test moving g2 : connector does not follow.
   When ungrouping g2, connector again connects to B.

Thanks a lot for all your work!

   Andreas

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/167168

tags: added: iso-testing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.