Rearranging XML nodes does not work correctly when changing hierarchy

Bug #501237 reported by Rena Kunisaki on 2009-12-29
16
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
Unassigned

Bug Description

Create a layer A with three sublayers X, Y and Z. Find A in the XML editor.

The first oddity (which seems like a bug, but probably just weridness in the SVG spec) is that the children of A are Z, Y, X, not X, Y Z as shown in the layers dialog (i.e. Z is the first element, X is the last).

If you try to drag X to above Z, instead, Y and Z switch places. If you try to drag another node from outside of A to above Z, the same happens. Often, these drag attempts simply do nothing - no change, no undo entry, as if you didn't drop it in a valid position, even though the marker indicates the position you dragged it to. This happens every time if X is not present.

The move up/down buttons do rearrange correctly.

description: updated
su_v (suv-lp) wrote :

> The first oddity (which seems like a bug, but probably just weridness in the SVG spec)

Layers are implemented as SVG groups, their stack order follows the same rules as z-order in general. For a layer to be listed as _first_ element in the 'Layers...' dialog, its corresponding group element must be drawn as _last_ top level element, i.e. it is near the end of the SVG source file. The XML Editor gives you a view of the SVG or XML structure of the document.

«Elements in an SVG document fragment have an implicit drawing order, with the first elements in the SVG document fragment getting "painted" first. Subsequent elements are painted on top of previously painted elements.»
<http://www.w3.org/TR/SVG11/render.html#RenderingOrder>

tags: added: ui xmleditor
Rena Kunisaki (i-am-inuyasha) wrote :

Makes sense. I was thinking of Z-order from the perspective of what you see rather than what order it would be drawn in.

su_v (suv-lp) wrote :

a) If you try to drag X to above Z, instead, Y and Z switch places.
b) If you try to drag another node from outside of A to above Z, the same happens.

In parts reproduced with Inkscape 0.47 on OS X 10.5.8: After opening the document it seems to work as expected until after dragging around several nodes it fails to re-arrange the nodes and only swaps either the last two nodes or the last and the selected one.

Closing Inkscape and re-opening the same document with above layer structure exposes the same behaviour: initially drag&drop works correctly and fails after either a sequence of several DnD operations or after a certain operation I haven't been able to pin point.

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp) wrote :

See also description & example in new duplicate
Bug #663779 “Drag-Drop in XML editor sometimes fail”
<https://bugs.launchpad.net/inkscape/+bug/663779>

«Apparently, the software does not update immediately the pointers between internals structures, and after few operations, the drag-drop is applied to an element which is not the the element selected. However, the selection marker on the drawing page is always correct.»

«Workaround: wait a rather long time, then the drag-drop operates as wanted for few operations and failed again after.
Workaround(bis): close the file and open again.»

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers