Hello walter, I have to come back to this topice once more.
As you saw in the code I posted, I now alter the collection of moved objects by extending “computeEffectiveCollection”. This works perfectly fine.
However, there is a problem. Refer to the image for understanding
The left two squares are group 1, the right two squares are group 2. Grid snapping is enabled.
If I move any of the elements in group 1, the other element also moves. Because of grid snapping, Both elements always jump by 5 units.
However, group 2 is different. the element “x” is not snapped to the grid (see gap “A”), because, in my application, I can always disable gridsnapping, move them by 1 unit with the arrow keys, or use intelligent snapping (Snapping to other objects - #6 by Hochware).
If I move the element “y” to the right for example, the following will happen:
- The element “y” will not move until the mouse moved at least enough to the right to trigger the snapping on the next grid-line “B”
-The element “x”, because it is grouped, will also move to the right. Because “x” is already closer to line “C” than “y” is to line “B”, it will snap sooner:
This means that the fine adjustment is lost as soon as I move any group with objects that are not snapped to the grid. (while gridsnapping is enabled, naturally)
So in order to prevent that, I need to flag all other elements in “computeEffectiveCollection” in a way so that they are not affected by gridsnapping, but by the position of the element which is dragged itself. Any clues on how to achieve this kind of behaviour?