Arrange seemingly swaps object positions before laying them out in a grid
When I use the arrange tool, it often swaps the position of objects instead of just aligning them nicely in a grid.
Steps to reproduce:
- open Inkscape
- create a few objects
- click "arrange" (see attached video for details)
Some of the objects were swapped around instead of just adjusted slightly and aligned in a grid.
What should have happened?
The objects positions should have been adjusted slightly and aligned, not swapped.
I have attached a a video and an svg file where I want to arrange a few text objects. The objects are already placed roughly in numerical order across two rows and three columns. When I click arrange, I would intuitively expect it to simply adjust vertical placement of the "3" and "1" while keeping the order intact. However, when I click "arrange" it swaps the places of the "3", "4", and "5".
In the inkscape rocket chat, @nathanal wrote this explanation for what is happening:
...the relevant function seems to be
sp_compare_x_position. It does a comparison based on visual bounding boxes. If two bounding boxes "roughly" overlap, they are considered in the same row and they are compared by x value, otherwise they are compared by y value
And submitted this video:
In additional, clicking arrange again keeps swapping tiles for a few rounds until it reaches a steady state where additional click does nothing. This is related to #617.
- Inkscape Version: Inkscape 1.0 (4035a4fb49, 2020-05-01) with Pango version: 1.44.7 - Operating System: Arch Linux - Operating System version: 5.7.7-arch1-1