This splits the tool into two separate tools: by center and
by even gaps. Previously, this was automatically decided, based on
if the items could have any gaps between them. This was unintuitive
as it would appear to arrange by centre point sometimes but not others.
When items aren't all the same width, the results can then be very
different, based only on the starting positions.
The new behaviour is to have a dedicated tool for each, which echos
how graphical programs like Inkscape manage this.
The by-gaps method is then extended to work for overlapping items
(when items overlap, the overlaps are made equal). The logic is
centralised in kimath/geometry, and some QA is added. This should
make it easier to extend to eeschema, for example.
This also (attempts to) address some rounding issues which could
cause minor, but compounding, errors to build up along the list
of items.
Also, fix bugs in the collection filtering - previously items
like markers were filtered out only after the selection size
was used to compute the gaps between items.
It's much more useful to use the locked items as targets.
Also fixes some issues with commits getting the wrong items when
pads are promoted to footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/6859
This fixes the handling of align/distribute tool when called on locked
items. Locked items cannot be moved but they may be used for the target
of an align/distribute operation.
Fixes: lp:1808238
* https://bugs.launchpad.net/kicad/+bug/1808238
When using the board edit, align tool automatically moved footprints
instead of pads but distribute tool did not. This standardizes the
behavior.
Fixes: lp:1796997
* https://bugs.launchpad.net/kicad/+bug/1796997
When aligning in pcbnew, check for pad/module locks before performing a
move and query the user.
When aligning on pads, don't move the pad without moving the footprint,
so we don't break footprints.
Fixes: lp:1751352
* https://bugs.launchpad.net/kicad/+bug/1751352
reimplement the centerpoint distribution and use it when the items to be
distributed overlap leaving no gap to use for spacing
Fixes: lp:1748763
* https://bugs.launchpad.net/kicad/+bug/1748763
Using footprint rects instead of the larger bounding box means that
reference and value texts no longer influence the positioning of the
footprint in unexpected ways. Treatment of non-module items is
unchanged.
- added TOOL_INTERACTIVE::resetTransitions()
- made protected and moved TOOL_BASE::setTransitions() to TOOL_INTERACTIVE
- TOOL_MANAGER calls TOOL_INTERACTIVE::resetTransitions() instead of
setTransitions()