Browse Source
ADDED: Rounded Rectangles
ADDED: Rounded Rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4742master
38 changed files with 535 additions and 89 deletions
-
1api/proto/common/types/base_types.proto
-
58common/eda_shape.cpp
-
36common/plotters/DXF_plotter.cpp
-
14common/plotters/GERBER_plotter.cpp
-
30common/plotters/PDF_plotter.cpp
-
30common/plotters/PS_plotter.cpp
-
5common/plotters/SVG_plotter.cpp
-
4common/plotters/plotter.cpp
-
2common/tool/edit_points.cpp
-
6eeschema/sch_file_versions.h
-
3eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_common.cpp
-
10eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp
-
17eeschema/sch_painter.cpp
-
4eeschema/sch_plotter.cpp
-
2eeschema/sch_shape.cpp
-
4eeschema/sch_sheet.cpp
-
16eeschema/tools/sch_point_editor.cpp
-
4include/eda_shape.h
-
3include/plotters/plotter.h
-
6include/plotters/plotter_dxf.h
-
3include/plotters/plotter_gerber.h
-
15include/plotters/plotters_pslike.h
-
5include/tool/edit_points.h
-
49libs/kimath/include/geometry/shape_rect.h
-
30libs/kimath/src/geometry/shape_rect.cpp
-
6pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp
-
3pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h
-
5pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp
-
107pcbnew/pcb_painter.cpp
-
2pcbnew/plot_board_layers.cpp
-
20pcbnew/plot_brditems_plotter.cpp
-
15pcbnew/tools/pcb_point_editor.cpp
-
1qa/tests/eeschema/CMakeLists.txt
-
36qa/tests/eeschema/test_shape_corner_radius.cpp
-
1qa/tests/libs/kimath/CMakeLists.txt
-
34qa/tests/libs/kimath/geometry/test_shape_rect_corner.cpp
-
1qa/tests/pcbnew/CMakeLists.txt
-
36qa/tests/pcbnew/test_shape_corner_radius.cpp
@ -0,0 +1,36 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 The 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 <qa_utils/wx_utils/unit_test_utils.h>
|
|||
#include <boost/test/unit_test.hpp>
|
|||
|
|||
#include <sch_shape.h>
|
|||
|
|||
BOOST_AUTO_TEST_CASE( SCHShapeCornerRadius ) |
|||
{ |
|||
SCH_SHAPE shape( SHAPE_T::RECTANGLE, LAYER_NOTES ); |
|||
shape.SetPosition( VECTOR2I( 0, 0 ) ); |
|||
shape.SetEnd( VECTOR2I( 100, 100 ) ); |
|||
shape.SetCornerRadius( 20 ); |
|||
BOOST_CHECK_EQUAL( shape.GetCornerRadius(), 20 ); |
|||
} |
@ -0,0 +1,34 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 The 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 <qa_utils/wx_utils/unit_test_utils.h>
|
|||
#include <boost/test/unit_test.hpp>
|
|||
|
|||
#include <geometry/shape_rect.h>
|
|||
|
|||
BOOST_AUTO_TEST_CASE( ShapeRectCornerRadius ) |
|||
{ |
|||
SHAPE_RECT rect( VECTOR2I( 0, 0 ), VECTOR2I( 10, 10 ) ); |
|||
rect.SetRadius( 2 ); |
|||
BOOST_CHECK_EQUAL( rect.GetRadius(), 2 ); |
|||
} |
@ -0,0 +1,36 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 The 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 <qa_utils/wx_utils/unit_test_utils.h>
|
|||
#include <boost/test/unit_test.hpp>
|
|||
|
|||
#include <pcb_shape.h>
|
|||
|
|||
BOOST_AUTO_TEST_CASE( PCBShapeCornerRadius ) |
|||
{ |
|||
PCB_SHAPE shape( nullptr, SHAPE_T::RECTANGLE ); |
|||
shape.SetStart( VECTOR2I( 0, 0 ) ); |
|||
shape.SetEnd( VECTOR2I( 1000, 1000 ) ); |
|||
shape.SetCornerRadius( 200 ); |
|||
BOOST_CHECK_EQUAL( shape.GetCornerRadius(), 200 ); |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue