Rework item distribution

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.
This commit is contained in:
John Beard 2024-05-04 15:41:21 +08:00
parent ce32dfd077
commit fa7e842c8c
80 changed files with 1179 additions and 357 deletions

View File

@ -446,8 +446,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_24.png" ), 24, wxT( "light" ) );
@ -852,8 +854,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_dark_24.png" ), 24, wxT( "dark" ) );
@ -1258,8 +1262,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_16.png" ), 16, wxT( "light" ) );
@ -1664,8 +1670,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_dark_16.png" ), 16, wxT( "dark" ) );
@ -2070,8 +2078,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_32.png" ), 32, wxT( "light" ) );
@ -2476,8 +2486,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_dark_32.png" ), 32, wxT( "dark" ) );
@ -2882,8 +2894,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_48.png" ), 48, wxT( "light" ) );
@ -3288,8 +3302,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_dark_48.png" ), 48, wxT( "dark" ) );
@ -3694,8 +3710,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_64.png" ), 64, wxT( "light" ) );
@ -4100,8 +4118,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::directory].emplace_back( BITMAPS::directory, wxT( "directory_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_browser].emplace_back( BITMAPS::directory_browser, wxT( "directory_browser_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::directory_open].emplace_back( BITMAPS::directory_open, wxT( "directory_open_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal].emplace_back( BITMAPS::distribute_horizontal, wxT( "distribute_horizontal_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical].emplace_back( BITMAPS::distribute_vertical, wxT( "distribute_vertical_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_centers].emplace_back( BITMAPS::distribute_horizontal_centers, wxT( "distribute_horizontal_centers_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_horizontal_gaps].emplace_back( BITMAPS::distribute_horizontal_gaps, wxT( "distribute_horizontal_gaps_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_centers].emplace_back( BITMAPS::distribute_vertical_centers, wxT( "distribute_vertical_centers_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::distribute_vertical_gaps].emplace_back( BITMAPS::distribute_vertical_gaps, wxT( "distribute_vertical_gaps_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::down].emplace_back( BITMAPS::down, wxT( "down_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag].emplace_back( BITMAPS::drag, wxT( "drag_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::drag_segment].emplace_back( BITMAPS::drag_segment, wxT( "drag_segment_dark_64.png" ), 64, wxT( "dark" ) );

View File

@ -155,8 +155,10 @@ enum class BITMAPS : unsigned int
directory_browser,
directory_open,
display_options,
distribute_horizontal,
distribute_vertical,
distribute_horizontal_centers,
distribute_horizontal_gaps,
distribute_vertical_centers,
distribute_vertical_gaps,
down,
drag,
drag_segment,

View File

@ -12,6 +12,7 @@ set( KIMATH_SRCS
src/trigo.cpp
src/geometry/chamfer.cpp
src/geometry/distribute.cpp
src/geometry/eda_angle.cpp
src/geometry/ellipse.cpp
src/geometry/circle.cpp

View File

@ -0,0 +1,43 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DISTRIBUTE_H
#define DISTRIBUTE_H
#include <utility>
#include <vector>
/**
* Given a list of 'n' item spans (e.g. left-right edge positions), return the deltas for
* each item to produce even gaps between each item.
*
* The first and last items will not be moved.
*
* @param aItemExtents a list of 'n' item spans, each a pair of integers representing the
* extents of an item. This should be sorted in a meaningful way to
* the caller, for example, left-right based on the item's left edge
* or by anchor.
*
* @return a vector of n deltas, the first and last will be 0.
*/
std::vector<int> GetDeltasForDistributeByGaps( const std::vector<std::pair<int, int>>& aItemExtents);
std::vector<int> GetDeltasForDistributeByPoints( const std::vector<int>& aItemPositions );
#endif // DISTRIBUTE_H

View File

@ -0,0 +1,89 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <geometry/distribute.h>
#include <math/vector2d.h>
std::vector<int> GetDeltasForDistributeByGaps(const std::vector<std::pair<int, int>>& aItemExtents)
{
std::vector<int> deltas(aItemExtents.size(), 0);
// This only makes sense for 3 or more items
if (aItemExtents.size() < 3)
return deltas;
// The space between the first and last items' inner edges
const int totalSpace = aItemExtents.back().first - aItemExtents.front().second;
int totalGap = totalSpace;
for( size_t i = 1; i < aItemExtents.size() - 1; ++i )
{
const auto& [start, end] = aItemExtents[i];
totalGap -= end - start;
}
const double perItemGap = totalGap / double( aItemExtents.size() - 1 );
// Start counting at the end of the first item
int targetPos = aItemExtents.begin()->second;
// End-cap items don't need to be changed
for( size_t i = 1; i < aItemExtents.size() - 1; ++i )
{
const auto& [start, end] = aItemExtents[i];
// Take care not to stack rounding errors by keeping the integer accumulator
// separate and always re-multiplying the gap
const double accumulatedGaps = i * perItemGap;
const int delta = targetPos - start + KiROUND(accumulatedGaps);
deltas[i] = delta;
// Step over one item span (width or height)
targetPos += end - start;
}
return deltas;
}
std::vector<int> GetDeltasForDistributeByPoints( const std::vector<int>& aItemPositions )
{
std::vector<int> deltas(aItemPositions.size(), 0);
// This only makes sense for 3 or more items
if (aItemPositions.size() < 3)
return deltas;
const int startPos = aItemPositions.front();
const int totalGaps = aItemPositions.back() - startPos;
const double itemGap = totalGaps / double( aItemPositions.size() - 1 );
// End-cap items don't need to be changed
for( size_t i = 1; i < aItemPositions.size() - 1; ++i )
{
const int targetPos = startPos + KiROUND( i * itemGap );
const int delta = targetPos - aItemPositions[i];
deltas[i] = delta;
}
return deltas;
}

View File

@ -1936,20 +1936,37 @@ TOOL_ACTION PCB_ACTIONS::alignCenterX( TOOL_ACTION_ARGS()
.Tooltip( _( "Aligns selected items to the horizontal center of the item under the cursor" ) )
.Icon( BITMAPS::align_items_middle ) );
TOOL_ACTION PCB_ACTIONS::distributeHorizontally( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeHorizontally" )
TOOL_ACTION PCB_ACTIONS::distributeHorizontallyCenters( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeHorizontallyCenters" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Distribute Horizontally" ) )
.Tooltip( _( "Distributes selected items between the left-most item and the right-most item" ) )
.Icon( BITMAPS::distribute_horizontal ) );
.FriendlyName( _( "Distribute Horizontally by Centers" ) )
.Tooltip( _( "Distributes selected items between the left-most item and the right-most item"
"so that the item centers are equally distributed" ) )
.Icon( BITMAPS::distribute_horizontal_centers ) );
TOOL_ACTION PCB_ACTIONS::distributeVertically( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeVertically" )
TOOL_ACTION PCB_ACTIONS::distributeHorizontallyGaps( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeHorizontallyGaps" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Distribute Vertically" ) )
.Tooltip( _( "Distributes selected items between the top-most item and the bottom-most item" ) )
.Icon( BITMAPS::distribute_vertical ) );
.FriendlyName( _( "Distribute Horizontally with Even Gaps" ) )
.Tooltip( _( "Distributes selected items between the left-most item and the right-most item "
"so that the gaps between items are equal" ) )
.Icon( BITMAPS::distribute_horizontal_gaps ) );
TOOL_ACTION PCB_ACTIONS::distributeVerticallyGaps( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeVerticallyGaps" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Distribute Vertically with Even Gaps" ) )
.Tooltip( _( "Distributes selected items between the top-most item and the bottom-most item "
"so that the gaps between items are equal" ) )
.Icon( BITMAPS::distribute_vertical_gaps ) );
TOOL_ACTION PCB_ACTIONS::distributeVerticallyCenters( TOOL_ACTION_ARGS()
.Name( "pcbnew.AlignAndDistribute.distributeVerticallyCenters" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Distribute Vertically by Centers" ) )
.Tooltip( _( "Distributes selected items between the top-most item and the bottom-most item "
"so that the item centers are equally distributed" ) )
.Icon( BITMAPS::distribute_vertical_centers ) );
// PCB_POINT_EDITOR
//

View File

@ -309,8 +309,10 @@ public:
static TOOL_ACTION alignRight;
static TOOL_ACTION alignCenterX;
static TOOL_ACTION alignCenterY;
static TOOL_ACTION distributeHorizontally;
static TOOL_ACTION distributeVertically;
static TOOL_ACTION distributeHorizontallyCenters;
static TOOL_ACTION distributeHorizontallyGaps;
static TOOL_ACTION distributeVerticallyCenters;
static TOOL_ACTION distributeVerticallyGaps;
// Position Relative Tool
/// Activation of the position relative tool

View File

@ -30,10 +30,11 @@
#include <ratsnest/ratsnest_data.h>
#include <tool/tool_manager.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_commit.h>
#include <bitmaps.h>
#include <pcb_edit_frame.h>
#include <geometry/distribute.h>
#include <view/view_controls.h>
@ -73,8 +74,10 @@ bool ALIGN_DISTRIBUTE_TOOL::Init()
m_placementMenu->Add( PCB_ACTIONS::alignBottom );
m_placementMenu->AppendSeparator();
m_placementMenu->Add( PCB_ACTIONS::distributeHorizontally );
m_placementMenu->Add( PCB_ACTIONS::distributeVertically );
m_placementMenu->Add( PCB_ACTIONS::distributeHorizontallyCenters );
m_placementMenu->Add( PCB_ACTIONS::distributeHorizontallyGaps );
m_placementMenu->Add( PCB_ACTIONS::distributeVerticallyCenters );
m_placementMenu->Add( PCB_ACTIONS::distributeVerticallyGaps );
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddMenu( m_placementMenu, SELECTION_CONDITIONS::MoreThan( 1 ), 100 );
@ -476,253 +479,136 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent )
}
int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent )
int ALIGN_DISTRIBUTE_TOOL::DistributeItems( const TOOL_EVENT& aEvent )
{
PCB_SELECTION& selection = m_selectionTool->RequestSelection(
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector,
PCB_SELECTION_TOOL* sTool )
{
// Iterate from the back so we don't have to worry about removals.
for( int i = aCollector.GetCount() - 1; i >= 0; --i )
{
BOARD_ITEM* item = aCollector[i];
if( item->Type() == PCB_MARKER_T )
aCollector.Remove( item );
}
sTool->FilterCollectorForMarkers( aCollector );
sTool->FilterCollectorForHierarchy( aCollector, true );
sTool->FilterCollectorForFreePads( aCollector );
},
m_frame->IsType( FRAME_PCB_EDITOR ) /* prompt user regarding locked items */ );
m_frame->IsType( FRAME_PCB_EDITOR ) /* prompt user regarding locked items */
);
if( selection.Size() <= 1 )
// Need at least 3 items to distribute - one at each end and at least on in the middle
if( selection.Size() < 3 )
return 0;
BOARD_COMMIT commit( m_frame );
wxString commitMsg;
std::vector<std::pair<BOARD_ITEM*, BOX2I>> itemsToDistribute = GetBoundingBoxes( selection );
// find the last item by reverse sorting
std::sort( itemsToDistribute.begin(), itemsToDistribute.end(),
[]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
return ( lhs.second.GetRight() > rhs.second.GetRight() );
} );
BOARD_ITEM* lastItem = itemsToDistribute.begin()->first;
const int maxRight = itemsToDistribute.begin()->second.GetRight();
// sort to get starting order
std::sort( itemsToDistribute.begin(), itemsToDistribute.end(),
[]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
return ( lhs.second.GetX() < rhs.second.GetX() );
} );
const int minX = itemsToDistribute.begin()->second.GetX();
int totalGap = maxRight - minX;
int totalWidth = 0;
for( const auto& [ item, rect ] : itemsToDistribute )
totalWidth += rect.GetWidth();
if( totalGap < totalWidth )
if( aEvent.Matches( PCB_ACTIONS::distributeHorizontallyCenters.MakeEvent() ) )
{
// the width of the items exceeds the gap (overlapping items) -> use center point spacing
doDistributeCentersHorizontally( itemsToDistribute, commit );
doDistributeCenters( true, itemsToDistribute, commit );
commitMsg = PCB_ACTIONS::distributeHorizontallyCenters.GetFriendlyName();
}
else if( aEvent.Matches( PCB_ACTIONS::distributeHorizontallyGaps.MakeEvent() ) )
{
doDistributeGaps( true, itemsToDistribute, commit );
commitMsg = PCB_ACTIONS::distributeHorizontallyGaps.GetFriendlyName();
}
else if( aEvent.Matches( PCB_ACTIONS::distributeVerticallyCenters.MakeEvent() ) )
{
doDistributeCenters( false, itemsToDistribute, commit );
commitMsg = PCB_ACTIONS::distributeVerticallyCenters.GetFriendlyName();
}
else
{
totalGap -= totalWidth;
doDistributeGapsHorizontally( itemsToDistribute, commit, lastItem, totalGap );
doDistributeGaps( false, itemsToDistribute, commit );
commitMsg = PCB_ACTIONS::distributeVerticallyGaps.GetFriendlyName();
}
commit.Push( _( "Distribute Horizontally" ) );
commit.Push( commitMsg );
return 0;
}
void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit,
const BOARD_ITEM* lastItem,
int totalGap ) const
{
const int itemGap = totalGap / ( aItems.size() - 1 );
int targetX = aItems.begin()->second.GetX();
for( const std::pair<BOARD_ITEM*, BOX2I>& i : aItems )
{
BOARD_ITEM* item = i.first;
// cover the corner case where the last item is wider than the previous item and gap
if( lastItem == item )
continue;
if( item->GetParent() && item->GetParent()->IsSelected() )
continue;
// Don't move a pad by itself unless editing the footprint
if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) )
item = item->GetParent();
int difference = targetX - i.second.GetX();
aCommit.Stage( item, CHT_MODIFY );
item->Move( VECTOR2I( difference, 0 ) );
targetX += ( i.second.GetWidth() + itemGap );
}
}
void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( std::vector<std::pair<BOARD_ITEM*, BOX2I>> &aItems,
BOARD_COMMIT& aCommit ) const
void ALIGN_DISTRIBUTE_TOOL::doDistributeGaps( bool aIsXAxis,
std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const
{
// Sort by start position.
// This is a simple way to get the items in a sensible order but it's not perfect.
// It will fail if, say, there's a huge items that's bigger than the total span of
// all the other items, but at that point a gap-equalising algorithm probably isn't
// well-defined anyway.
std::sort( aItems.begin(), aItems.end(),
[]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
return ( lhs.second.Centre().x < rhs.second.Centre().x );
} );
[&]( const std::pair<BOARD_ITEM*, BOX2I>& a, const std::pair<BOARD_ITEM*, BOX2I>& b )
{
return aIsXAxis ? a.second.GetLeft() < b.second.GetLeft()
: a.second.GetTop() < b.second.GetTop();
} );
const int totalGap = ( aItems.end()-1 )->second.Centre().x - aItems.begin()->second.Centre().x;
const int itemGap = totalGap / ( aItems.size() - 1 );
int targetX = aItems.begin()->second.Centre().x;
// Consruct list of item spans in the relevant axis
std::vector<std::pair<int, int>> itemSpans;
itemSpans.reserve( aItems.size() );
for( const std::pair<BOARD_ITEM*, BOX2I>& i : aItems )
for( const auto& [item, box] : aItems )
{
BOARD_ITEM* item = i.first;
if( item->GetParent() && item->GetParent()->IsSelected() )
continue;
// Don't move a pad by itself unless editing the footprint
if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) )
item = item->GetParent();
int difference = targetX - i.second.Centre().x;
aCommit.Stage( item, CHT_MODIFY );
item->Move( VECTOR2I( difference, 0 ) );
targetX += ( itemGap );
}
}
int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent )
{
PCB_SELECTION& selection = m_selectionTool->RequestSelection(
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
{
// Iterate from the back so we don't have to worry about removals.
for( int i = aCollector.GetCount() - 1; i >= 0; --i )
{
BOARD_ITEM* item = aCollector[i];
if( item->Type() == PCB_MARKER_T )
aCollector.Remove( item );
}
},
m_frame->IsType( FRAME_PCB_EDITOR ) /* prompt user regarding locked items */ );
if( selection.Size() <= 1 )
return 0;
BOARD_COMMIT commit( m_frame );
std::vector<std::pair<BOARD_ITEM*, BOX2I>> itemsToDistribute = GetBoundingBoxes( selection );
// find the last item by reverse sorting
std::sort( itemsToDistribute.begin(), itemsToDistribute.end(),
[]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
return ( lhs.second.GetBottom() > rhs.second.GetBottom() );
} );
BOARD_ITEM* lastItem = itemsToDistribute.begin()->first;
const int maxBottom = itemsToDistribute.begin()->second.GetBottom();
// sort to get starting order
std::sort( itemsToDistribute.begin(), itemsToDistribute.end(),
[]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
return ( lhs.second.Centre().y < rhs.second.Centre().y );
} );
int minY = itemsToDistribute.begin()->second.GetY();
int totalGap = maxBottom - minY;
int totalHeight = 0;
for( const std::pair<BOARD_ITEM*, BOX2I>& i : itemsToDistribute )
totalHeight += i.second.GetHeight();
if( totalGap < totalHeight )
{
// the width of the items exceeds the gap (overlapping items) -> use center point spacing
doDistributeCentersVertically( itemsToDistribute, commit );
}
else
{
totalGap -= totalHeight;
doDistributeGapsVertically( itemsToDistribute, commit, lastItem, totalGap );
const int start = aIsXAxis ? box.GetLeft() : box.GetTop();
const int end = aIsXAxis ? box.GetRight() : box.GetBottom();
itemSpans.emplace_back( start, end );
}
commit.Push( _( "Distribute Vertically" ) );
return 0;
}
// Get the deltas needed to distribute the items evenly
const std::vector<int> deltas = GetDeltasForDistributeByGaps( itemSpans );
void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit,
const BOARD_ITEM* lastItem,
int totalGap ) const
{
const int itemGap = totalGap / ( aItems.size() - 1 );
int targetY = aItems.begin()->second.GetY();
for( std::pair<BOARD_ITEM*, BOX2I>& i : aItems )
// Apply the deltas to the items
for( size_t i = 1; i < aItems.size() - 1; ++i )
{
BOARD_ITEM* item = i.first;
const auto& [item, box] = aItems[i];
const int delta = deltas[i];
// cover the corner case where the last item is wider than the previous item and gap
if( lastItem == item )
continue;
if( item->GetParent() && item->GetParent()->IsSelected() )
continue;
// Don't move a pad by itself unless editing the footprint
if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) )
item = item->GetParent();
int difference = targetY - i.second.GetY();
aCommit.Stage( item, CHT_MODIFY );
item->Move( VECTOR2I( 0, difference ) );
targetY += ( i.second.GetHeight() + itemGap );
}
}
void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const
{
std::sort( aItems.begin(), aItems.end(),
[] ( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs)
if( delta != 0 )
{
return ( lhs.second.Centre().y < rhs.second.Centre().y );
} );
const VECTOR2I deltaVec = aIsXAxis ? VECTOR2I( delta, 0 ) : VECTOR2I( 0, delta );
const int totalGap = ( aItems.end() - 1 )->second.Centre().y
- aItems.begin()->second.Centre().y;
const int itemGap = totalGap / ( aItems.size() - 1 );
int targetY = aItems.begin()->second.Centre().y;
aCommit.Stage( item, CHT_MODIFY );
item->Move( deltaVec );
}
}
}
for( const std::pair<BOARD_ITEM*, BOX2I>& i : aItems )
void ALIGN_DISTRIBUTE_TOOL::doDistributeCenters( bool aIsXAxis,
std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const
{
std::sort(
aItems.begin(), aItems.end(),
[&]( const std::pair<BOARD_ITEM*, BOX2I>& lhs, const std::pair<BOARD_ITEM*, BOX2I>& rhs )
{
const int lhsPos = aIsXAxis ? lhs.second.Centre().x : lhs.second.Centre().y;
const int rhsPos = aIsXAxis ? rhs.second.Centre().x : rhs.second.Centre().y;
return lhsPos < rhsPos;
} );
std::vector<int> itemCenters;
itemCenters.reserve( aItems.size() );
for( const auto& [item, box] : aItems )
{
BOARD_ITEM* item = i.first;
itemCenters.push_back( aIsXAxis ? box.Centre().x : box.Centre().y );
}
if( item->GetParent() && item->GetParent()->IsSelected() )
continue;
const std::vector<int> deltas = GetDeltasForDistributeByPoints( itemCenters );
// Don't move a pad by itself unless editing the footprint
if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) )
item = item->GetParent();
// Apply the deltas to the items
for( size_t i = 1; i < aItems.size() - 1; ++i )
{
const auto& [item, box] = aItems[i];
const int delta = deltas[i];
int difference = targetY - i.second.Centre().y;
aCommit.Stage( item, CHT_MODIFY );
item->Move( VECTOR2I( 0, difference ) );
targetY += ( itemGap );
if ( delta != 0)
{
const VECTOR2I deltaVec = aIsXAxis ? VECTOR2I( delta, 0 ) : VECTOR2I( 0, delta );
aCommit.Stage( item, CHT_MODIFY );
item->Move( deltaVec );
}
}
}
@ -736,8 +622,12 @@ void ALIGN_DISTRIBUTE_TOOL::setTransitions()
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterX, PCB_ACTIONS::alignCenterX.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterY, PCB_ACTIONS::alignCenterY.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally,
PCB_ACTIONS::distributeHorizontally.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeVertically,
PCB_ACTIONS::distributeVertically.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeItems,
PCB_ACTIONS::distributeHorizontallyCenters.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeItems,
PCB_ACTIONS::distributeHorizontallyGaps.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeItems,
PCB_ACTIONS::distributeVerticallyCenters.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeItems,
PCB_ACTIONS::distributeVerticallyGaps.MakeEvent() );
}

View File

@ -85,14 +85,9 @@ public:
int AlignCenterY( const TOOL_EVENT& aEvent );
/**
* Distribute the selected items along the X axis.
* Distribute the selected items in some way
*/
int DistributeHorizontally( const TOOL_EVENT& aEvent );
/**
* Distribute the selected items along the Y axis.
*/
int DistributeVertically( const TOOL_EVENT& aEvent );
int DistributeItems( const TOOL_EVENT& aEvent );
///< Set up handlers for various events.
void setTransitions() override;
@ -129,17 +124,6 @@ private:
*/
int doAlignRight();
/**
* Distribute selected items using an even spacing between the centers of their bounding
* boxes.
*
* @note Using the centers of bounding box of items can give unsatisfactory visual results
* since items of differing widths will be placed with different gaps. Is only used if
* items overlap.
*/
void doDistributeCentersHorizontally( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const;
/**
* Distribute selected items using an even spacing between the centers of their bounding
* boxes.
@ -148,28 +132,18 @@ private:
* since items of differing widths will be placed with different gaps. Is only used
* if items overlap
*/
void doDistributeCentersVertically( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const;
void doDistributeCenters( bool aIsXAxis, std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const;
/**
* Distributes selected items using an even spacing between their bounding boxes
* Distributes selected items using an even spacing between their bounding boxe
* in the x or y axis.
*
* @note Using the edges of bounding box of items is only possible if there is enough space
* between them. If this is not the case, use the center spacing method
* @note If the total item widths exceed the available space, the overlaps will be
* distributed evenly.
*/
void doDistributeGapsHorizontally( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem,
int totalGap ) const;
/**
* Distributes selected items using an even spacing between their bounding boxes
*
* @note Using the edges of bounding box of items is only possible if there is enough space
* between them. If this is not the case, use the center spacing method
*/
void doDistributeGapsVertically( std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem,
int totalGap ) const;
void doDistributeGaps( bool aIsXAxis, std::vector<std::pair<BOARD_ITEM*, BOX2I>>& aItems,
BOARD_COMMIT& aCommit ) const;
private:
PCB_SELECTION_TOOL* m_selectionTool;

View File

@ -28,6 +28,7 @@ set( QA_KIMATH_SRCS
test_kimath.cpp
geometry/test_chamfer.cpp
geometry/test_distribute.cpp
geometry/test_eda_angle.cpp
geometry/test_ellipse_to_bezier.cpp
geometry/test_fillet.cpp

View File

@ -0,0 +1,169 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <boost/test/unit_test.hpp>
#include <geometry/distribute.h>
#include "geom_test_utils.h"
struct DistributeFixture
{
};
/**
* Declares the FilletFixture struct as the boost test fixture.
*/
BOOST_FIXTURE_TEST_SUITE( Distribute, DistributeFixture )
struct DISTRIBUTE_GAPS_TEST_CASE
{
std::vector<std::pair<int, int>> m_extents;
std::vector<int> m_expectedDeltas;
};
static void DoDistributeGapsTestChecks( const DISTRIBUTE_GAPS_TEST_CASE& aTestCase )
{
// Actally do the chamfer
const std::vector<int> deltas = GetDeltasForDistributeByGaps( aTestCase.m_extents );
BOOST_REQUIRE_EQUAL( deltas.size(), aTestCase.m_expectedDeltas.size() );
// First and last items should not be moved
BOOST_CHECK_EQUAL( deltas.front(), 0 );
BOOST_CHECK_EQUAL( deltas.back(), 0 );
for( size_t i = 0; i < deltas.size(); ++i )
{
BOOST_CHECK_EQUAL( deltas[i], aTestCase.m_expectedDeltas[i] );
}
}
BOOST_AUTO_TEST_CASE( DistributeGapsNoChangeNeeded )
{
const DISTRIBUTE_GAPS_TEST_CASE testcase{
{
// Already evenly spaced (100 gaps)
{ 0, 100 },
{ 200, 300 },
{ 400, 500 },
},
{ 0, 0, 0 },
};
DoDistributeGapsTestChecks( testcase );
}
BOOST_AUTO_TEST_CASE( DistributeGapsSimpleShiftNeeded )
{
const DISTRIBUTE_GAPS_TEST_CASE testcase{
{
// Need to move item 1 51 to the right
{ 0, 100 },
{ 149, 249 },
{ 400, 500 },
},
{ 0, 51, 0 },
};
DoDistributeGapsTestChecks( testcase );
}
BOOST_AUTO_TEST_CASE( DistributeGapsRounding )
{
const DISTRIBUTE_GAPS_TEST_CASE testcase{
{
// Have to fit 3 gaps into total sum of gaps of 100
// so 33.333333 per gap
// (note one rounds up, the other down)
{ -100, 0 },
{ 0, 100 }, // Move this to 33 .. 133
{ 0, 100 }, // Move this to 167 .. 267
{ 300, 400 },
},
{ 0, 33, 167, 0 },
};
DoDistributeGapsTestChecks( testcase );
}
struct DISTRIBUTE_POINTS_TEST_CASE
{
std::vector<int> m_points;
std::vector<int> m_expectedDeltas;
};
static void DoDistributePointsTestChecks( const DISTRIBUTE_POINTS_TEST_CASE& aTestCase )
{
// Actally do the chamfer
const std::vector<int> deltas = GetDeltasForDistributeByPoints( aTestCase.m_points );
BOOST_REQUIRE_EQUAL( deltas.size(), aTestCase.m_expectedDeltas.size() );
// First and last items should not be moved
BOOST_CHECK_EQUAL( deltas.front(), 0 );
BOOST_CHECK_EQUAL( deltas.back(), 0 );
for( size_t i = 0; i < deltas.size(); ++i )
{
BOOST_CHECK_EQUAL( deltas[i], aTestCase.m_expectedDeltas[i] );
}
}
BOOST_AUTO_TEST_CASE( DistributePointsNoChangeNeeded )
{
const DISTRIBUTE_POINTS_TEST_CASE testcase{
// Already evenly spaced (100 gaps)
{ 0, 100, 200, 300, 400 },
{ 0, 0, 0, 0, 0 },
};
DoDistributePointsTestChecks( testcase );
}
BOOST_AUTO_TEST_CASE( DistributePointsSimpleShiftNeeded )
{
const DISTRIBUTE_POINTS_TEST_CASE testcase{
// Need to move item 1 51 to the right
{ 0, 49, 200 },
{ 0, 51, 0 },
};
DoDistributePointsTestChecks( testcase );
}
BOOST_AUTO_TEST_CASE( DistributePointsRounding )
{
const DISTRIBUTE_POINTS_TEST_CASE testcase{
// Have to fit 3 gaps into total sum of gaps of 100
// so 33.333333 per gap
// (note one rounds up, the other down)
{ 0, 0, 0, 100 },
{ 0, 33, 67, 0 },
};
DoDistributePointsTestChecks( testcase );
}
BOOST_AUTO_TEST_SUITE_END()

View File

@ -247,8 +247,10 @@ set( BMAPS_MID
directory
directory_browser
directory_open
distribute_horizontal
distribute_vertical
distribute_horizontal_centers
distribute_horizontal_gaps
distribute_vertical_centers
distribute_vertical_gaps
down
drag
drag_segment

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_horizontal.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)">
sodipodi:docname="distribute_horizontal_centers.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@ -27,13 +27,16 @@
id="namedview30"
showgrid="true"
inkscape:zoom="12.44317"
inkscape:cx="-0.2102443"
inkscape:cy="11.343495"
inkscape:cx="-0.24109612"
inkscape:cy="11.3717"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
@ -41,19 +44,23 @@
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_arc</dc:title>
<dc:title>distribute_horizontal_centers</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
@ -78,7 +85,7 @@
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_horizontal</title>
id="title116576">distribute_horizontal_centers</title>
<path
id="line116578"
style="fill:none;stroke:#42B8EB;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_horizontal_gaps.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1128"
id="namedview30"
showgrid="true"
inkscape:zoom="35.593594"
inkscape:cx="11.027265"
inkscape:cy="21.127397"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_horizontal_gaps</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs116574">
<style
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_horizontal_gaps</title>
<path
id="line116578"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 17,6 V 1.9137056"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-20"
y="16.99995"
width="10"
height="5.0001001"
id="rect116580"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.790575"
transform="rotate(-90)" />
<path
id="line116586"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 6,6 V 1.9999999"
sodipodi:nodetypes="cc" />
<path
id="line116586-3"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 10,6 V 2"
sodipodi:nodetypes="cc" />
<path
id="line116586-3-6"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 13,6 V 2"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-22.000599"
y="1.999236"
width="13.999763"
height="3.9984019"
transform="matrix(-7.1047487e-5,-1,0.99999999,-1.3930147e-4,0,0)"
id="rect116588"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.707053" />
<rect
class="cls-2"
x="-21"
y="9.9999495"
width="12"
height="2.9992523"
id="rect1"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.790575"
transform="rotate(-90)" />
<path
id="path1"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 17,4 H 13"
sodipodi:nodetypes="cc" />
<path
id="path2"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 10,4 H 6"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_vertical.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)">
sodipodi:docname="distribute_vertical_centers.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@ -27,13 +27,16 @@
id="namedview30"
showgrid="true"
inkscape:zoom="20.307321"
inkscape:cx="3.7212448"
inkscape:cy="17.025425"
inkscape:cx="3.7424927"
inkscape:cy="17.112055"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
@ -41,19 +44,23 @@
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_horizontal</dc:title>
<dc:title>distribute_vertical_centers</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
@ -78,7 +85,7 @@
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_horizontal</title>
id="title116576">distribute_vertical_centers</title>
<path
id="line116578"
style="fill:none;stroke:#42B8EB;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_vertical_gaps.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1128"
id="namedview30"
showgrid="true"
inkscape:zoom="27.184731"
inkscape:cx="10.207936"
inkscape:cy="10.85168"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_vertical_gaps</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs116574">
<style
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_vertical_gaps</title>
<path
id="line116578"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 5.9996803,7.0007995 H 1.9133859"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-19.999681"
y="-7.0008492"
width="10"
height="5.0001001"
id="rect116580"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.790575"
transform="scale(-1)" />
<path
id="line116586"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 5.9996803,18.000799 H 1.9996802"
sodipodi:nodetypes="cc" />
<path
id="line116586-3"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="m 5.9996803,14.000799 h -4"
sodipodi:nodetypes="cc" />
<path
id="line116586-3-6"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="m 5.9996803,11.000799 h -4"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-21.996935"
y="-22.001562"
width="13.999763"
height="3.9984019"
transform="matrix(-1,7.1047487e-5,-1.3930147e-4,-0.99999999,0,0)"
id="rect116588"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.707053" />
<rect
class="cls-2"
x="-20.999681"
y="-14.00085"
width="12"
height="2.9992523"
id="rect1"
style="fill:#ded3dd;fill-opacity:1;stroke-width:0.790575"
transform="scale(-1)" />
<path
id="path1"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 3.9996803,7.0007995 V 11.000799"
sodipodi:nodetypes="cc" />
<path
id="path2"
style="fill:none;stroke:#42b8eb;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
d="m 3.9996803,14.000799 v 4"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_horizontal.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)">
sodipodi:docname="distribute_horizontal_centers.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@ -27,13 +27,16 @@
id="namedview30"
showgrid="true"
inkscape:zoom="12.44317"
inkscape:cx="-0.2102443"
inkscape:cy="11.343495"
inkscape:cx="-0.24109612"
inkscape:cy="11.3717"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
@ -41,19 +44,23 @@
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_arc</dc:title>
<dc:title>distribute_horizontal_centers</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
@ -78,7 +85,7 @@
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#1a81c4;stroke-width:1.0035px;}.cls-2{fill:#b9b9b9;}.cls-3{stroke:#545454;}.cls-4{fill:#545454;}</style>
</defs>
<title
id="title116576">distribute_horizontal</title>
id="title116576">distribute_horizontal_centers</title>
<path
id="line116578"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_horizontal_gaps.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1128"
id="namedview30"
showgrid="true"
inkscape:zoom="19.417604"
inkscape:cx="16.71164"
inkscape:cy="15.243899"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_horizontal_gaps</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs116574">
<style
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_horizontal_gaps</title>
<path
id="line116578"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 17,6 V 1.9137056"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-20"
y="16.99995"
width="10"
height="5.0001001"
id="rect116580"
style="fill:#545454;fill-opacity:1;stroke-width:0.790575"
transform="rotate(-90)" />
<path
id="line116586"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 6,6 V 1.9999999"
sodipodi:nodetypes="cc" />
<path
id="line116586-3"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 10,6 V 2"
sodipodi:nodetypes="cc" />
<path
id="line116586-3-6"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 13,6 V 2"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-22.000599"
y="1.999236"
width="13.999763"
height="3.9984019"
transform="matrix(-7.1047487e-5,-1,0.99999999,-1.3930147e-4,0,0)"
id="rect116588"
style="fill:#545454;fill-opacity:1;stroke-width:0.707053" />
<rect
class="cls-2"
x="-21"
y="9.9999495"
width="12"
height="2.9992523"
id="rect1"
style="fill:#545454;fill-opacity:1;stroke-width:0.790575"
transform="rotate(-90)" />
<path
id="path1"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 17,4 H 13"
sodipodi:nodetypes="cc" />
<path
id="path2"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 10,4 H 6"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_vertical.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)">
sodipodi:docname="distribute_vertical_centers.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@ -27,13 +27,16 @@
id="namedview30"
showgrid="true"
inkscape:zoom="20.307321"
inkscape:cx="3.7212448"
inkscape:cy="17.025425"
inkscape:cx="3.7424927"
inkscape:cy="17.112055"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
@ -41,19 +44,23 @@
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_horizontal</dc:title>
<dc:title>distribute_vertical_centers</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
@ -78,7 +85,7 @@
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#1a81c4;stroke-width:1.0035px;}.cls-2{fill:#b9b9b9;}.cls-3{stroke:#545454;}.cls-4{fill:#545454;}</style>
</defs>
<title
id="title116576">distribute_horizontal</title>
id="title116576">distribute_vertical_centers</title>
<path
id="line116578"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="distribute_vertical_gaps.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1128"
id="namedview30"
showgrid="true"
inkscape:zoom="8.475776"
inkscape:cx="32.858348"
inkscape:cy="6.0171482"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2"
originx="0"
originy="0"
units="px"
visible="true" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>distribute_vertical_gaps</dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs116574">
<style
id="style116572">.cls-1,.cls-3{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-1{stroke:#42B8EB;stroke-width:1.0035px;}.cls-2{fill:#8f8f8f;}.cls-3{stroke:#DED3DD;}.cls-4{fill:#DED3DD;}</style>
</defs>
<title
id="title116576">distribute_vertical_gaps</title>
<path
id="line116578"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="M 5.9996803,7.0007995 H 1.9133859"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-19.999681"
y="-7.0008492"
width="10"
height="5.0001001"
id="rect116580"
style="fill:#545454;fill-opacity:1;stroke-width:0.790575"
transform="scale(-1)" />
<path
id="line116586"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="M 5.9996803,18.000799 H 1.9996802"
sodipodi:nodetypes="cc" />
<path
id="line116586-3"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="m 5.9996803,14.000799 h -4"
sodipodi:nodetypes="cc" />
<path
id="line116586-3-6"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="m 5.9996803,11.000799 h -4"
sodipodi:nodetypes="cc" />
<rect
class="cls-2"
x="-21.996935"
y="-22.001562"
width="13.999763"
height="3.9984019"
transform="matrix(-1,7.1047487e-5,-1.3930147e-4,-0.99999999,0,0)"
id="rect116588"
style="fill:#545454;fill-opacity:1;stroke-width:0.707053" />
<rect
class="cls-2"
x="-20.999681"
y="-14.00085"
width="12"
height="2.9992523"
id="rect1"
style="fill:#545454;fill-opacity:1;stroke-width:0.790575"
transform="scale(-1)" />
<path
id="path1"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="M 3.9996803,7.0007995 V 11.000799"
sodipodi:nodetypes="cc" />
<path
id="path2"
style="fill:none;stroke:#1a81c4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1"
d="m 3.9996803,14.000799 v 4"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB