Skip to content

Distribute/Move considers stack order if object has same position

Nathan Lee requested to merge nathanal/inkscape:stacksort into master

Problem: if objects are in the same position, Distribute (of Align and Distribute) and Move (of the Transform Dialog, with apply separately and relative move checked) apply to the objects in a random order (based on what std::sort decide to do).

Solution: in conflict, use stack order.

This may be need UX input first

I have a different patch that uses selection order instead of stack order. Edit: https://gitlab.com/nathanal/inkscape/commits/stablesort

Selection order may have confusing outputs if the items (that are in the same position) weren't selected all at once.

But selection order allows more control over the order (i.e. if this was intended!).


A caveat with this MR. Last night I had an issue when testing.
Test case: identical objects on top of each other, using move in the transform dialog).
Problem: sort was out of order. It turns out only the top object had its stroke factored in to its visual bounding box, messing up the sorting algorithm.

Since the debug information only makes sense when applied to this MR, I can't imagine what mistake I could have made. Anyway, today I can't replicate the problem anymore.

Address gitlab.com/inkscape/inbox/issues/665

Edited by Nathan Lee

Merge request reports