Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
2b1d6b30
Commit
2b1d6b30
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for module edge splitting with double click.
parent
47f1fec3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
point_editor.cpp
pcbnew/tools/point_editor.cpp
+32
-3
No files found.
pcbnew/tools/point_editor.cpp
View file @
2b1d6b30
...
...
@@ -40,6 +40,7 @@
#include <class_dimension.h>
#include <class_zone.h>
#include <class_board.h>
#include <class_module.h>
// Few constants to avoid using bare numbers for point indices
enum
SEG_POINTS
...
...
@@ -710,8 +711,14 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
else
if
(
item
->
Type
()
==
PCB_LINE_T
||
item
->
Type
()
==
PCB_MODULE_EDGE_T
)
{
bool
moduleEdge
=
item
->
Type
()
==
PCB_MODULE_EDGE_T
;
getEditFrame
<
PCB_BASE_FRAME
>
()
->
OnModify
();
getEditFrame
<
PCB_BASE_FRAME
>
()
->
SaveCopyInUndoList
(
selection
.
items
,
UR_CHANGED
);
if
(
moduleEdge
)
getEditFrame
<
PCB_BASE_FRAME
>
()
->
SaveCopyInUndoList
(
getModel
<
BOARD
>
()
->
m_Modules
,
UR_MODEDIT
);
else
getEditFrame
<
PCB_BASE_FRAME
>
()
->
SaveCopyInUndoList
(
selection
.
items
,
UR_CHANGED
);
DRAWSEGMENT
*
segment
=
static_cast
<
DRAWSEGMENT
*>
(
item
);
...
...
@@ -724,12 +731,34 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
segment
->
SetEnd
(
wxPoint
(
nearestPoint
.
x
,
nearestPoint
.
y
)
);
// and add another one starting from the break point
DRAWSEGMENT
*
newSegment
=
new
DRAWSEGMENT
(
*
segment
);
DRAWSEGMENT
*
newSegment
;
if
(
moduleEdge
)
{
EDGE_MODULE
*
edge
=
static_cast
<
EDGE_MODULE
*>
(
segment
);
assert
(
segment
->
GetParent
()
->
Type
()
==
PCB_MODULE_T
);
newSegment
=
new
EDGE_MODULE
(
*
edge
);
edge
->
SetLocalCoord
();
}
else
{
newSegment
=
new
DRAWSEGMENT
(
*
segment
);
}
newSegment
->
ClearSelected
();
newSegment
->
SetStart
(
wxPoint
(
nearestPoint
.
x
,
nearestPoint
.
y
)
);
newSegment
->
SetEnd
(
wxPoint
(
seg
.
B
.
x
,
seg
.
B
.
y
)
);
getModel
<
BOARD
>
()
->
Add
(
newSegment
);
if
(
moduleEdge
)
{
static_cast
<
EDGE_MODULE
*>
(
newSegment
)
->
SetLocalCoord
();
getModel
<
BOARD
>
()
->
m_Modules
->
Add
(
newSegment
);
}
else
{
getModel
<
BOARD
>
()
->
Add
(
newSegment
);
}
getView
()
->
Add
(
newSegment
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment