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
9783aaf3
Commit
9783aaf3
authored
Mar 18, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Splitting DRAWSEGMENTs with POINT_EDITOR.
parent
17ec7ace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
point_editor.cpp
pcbnew/tools/point_editor.cpp
+27
-0
No files found.
pcbnew/tools/point_editor.cpp
View file @
9783aaf3
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include <class_drawsegment.h>
#include <class_drawsegment.h>
#include <class_dimension.h>
#include <class_dimension.h>
#include <class_zone.h>
#include <class_zone.h>
#include <class_board.h>
/**
/**
* Class POINT_EDITOR
* Class POINT_EDITOR
...
@@ -653,4 +654,30 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
...
@@ -653,4 +654,30 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
outline
->
InsertCorner
(
nearestIdx
,
nearestPoint
.
x
,
nearestPoint
.
y
);
outline
->
InsertCorner
(
nearestIdx
,
nearestPoint
.
x
,
nearestPoint
.
y
);
}
}
else
if
(
item
->
Type
()
==
PCB_LINE_T
)
{
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnModify
();
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SaveCopyInUndoList
(
selection
.
items
,
UR_CHANGED
);
DRAWSEGMENT
*
segment
=
static_cast
<
DRAWSEGMENT
*>
(
item
);
if
(
segment
->
GetShape
()
==
S_SEGMENT
)
{
SEG
seg
(
segment
->
GetStart
(),
segment
->
GetEnd
()
);
VECTOR2I
nearestPoint
=
seg
.
NearestPoint
(
aBreakPoint
);
// Move the end of the line to the break point..
segment
->
SetEnd
(
wxPoint
(
nearestPoint
.
x
,
nearestPoint
.
y
)
);
// and add another one starting from the break point
DRAWSEGMENT
*
newSegment
=
new
DRAWSEGMENT
(
*
segment
);
newSegment
->
ClearSelected
();
newSegment
->
SetStart
(
wxPoint
(
nearestPoint
.
x
,
nearestPoint
.
y
)
);
newSegment
->
SetEnd
(
wxPoint
(
seg
.
B
.
x
,
seg
.
B
.
y
)
);
getModel
<
BOARD
>
(
PCB_T
)
->
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