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
d1ffaf0d
Commit
d1ffaf0d
authored
Feb 28, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Circles are supported by POINT_EDITOR.
parent
3c656691
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
point_editor.cpp
pcbnew/tools/point_editor.cpp
+35
-3
No files found.
pcbnew/tools/point_editor.cpp
View file @
d1ffaf0d
...
...
@@ -72,6 +72,10 @@ public:
(
*
points
)[
2
].
SetConstraint
(
new
EPC_CIRCLE
(
(
*
points
)[
2
],
(
*
points
)[
0
],
(
*
points
)[
1
]
)
);
break
;
case
S_CIRCLE
:
points
->
Add
(
segment
->
GetCenter
()
);
points
->
Add
(
segment
->
GetEnd
()
);
default
:
// suppress warnings
break
;
}
...
...
@@ -219,9 +223,12 @@ void POINT_EDITOR::updateItem() const
{
case
S_SEGMENT
:
if
(
&
(
*
m_editPoints
)[
0
]
==
m_dragPoint
)
segment
->
SetStart
(
wxPoint
(
(
*
m_editPoints
)[
0
].
GetPosition
().
x
,
(
*
m_editPoints
)[
0
].
GetPosition
().
y
)
);
segment
->
SetStart
(
wxPoint
(
(
*
m_editPoints
)[
0
].
GetPosition
().
x
,
(
*
m_editPoints
)[
0
].
GetPosition
().
y
)
);
else
if
(
&
(
*
m_editPoints
)[
1
]
==
m_dragPoint
)
segment
->
SetEnd
(
wxPoint
(
(
*
m_editPoints
)[
1
].
GetPosition
().
x
,
(
*
m_editPoints
)[
1
].
GetPosition
().
y
)
);
segment
->
SetEnd
(
wxPoint
(
(
*
m_editPoints
)[
1
].
GetPosition
().
x
,
(
*
m_editPoints
)[
1
].
GetPosition
().
y
)
);
break
;
...
...
@@ -250,6 +257,7 @@ void POINT_EDITOR::updateItem() const
// Adjust the new angle to (counter)clockwise setting
bool
clockwise
=
(
segment
->
GetAngle
()
>
0
);
if
(
clockwise
&&
newAngle
<
0.0
)
newAngle
+=
3600.0
;
else
if
(
!
clockwise
&&
newAngle
>
0.0
)
...
...
@@ -257,8 +265,27 @@ void POINT_EDITOR::updateItem() const
segment
->
SetAngle
(
newAngle
);
}
break
;
}
case
S_CIRCLE
:
{
const
VECTOR2I
&
center
=
(
*
m_editPoints
)[
0
].
GetPosition
();
const
VECTOR2I
&
end
=
(
*
m_editPoints
)[
1
].
GetPosition
();
if
(
m_dragPoint
==
&
(
*
m_editPoints
)[
0
]
)
{
wxPoint
moveVector
=
wxPoint
(
center
.
x
,
center
.
y
)
-
segment
->
GetCenter
();
segment
->
Move
(
moveVector
);
}
else
{
segment
->
SetEnd
(
wxPoint
(
end
.
x
,
end
.
y
)
);
}
break
;
}
break
;
default
:
// suppress warnings
break
;
...
...
@@ -295,6 +322,11 @@ void POINT_EDITOR::updatePoints() const
(
*
m_editPoints
)[
2
].
SetPosition
(
segment
->
GetArcEnd
()
);
break
;
case
S_CIRCLE
:
(
*
m_editPoints
)[
0
].
SetPosition
(
segment
->
GetCenter
()
);
(
*
m_editPoints
)[
1
].
SetPosition
(
segment
->
GetEnd
()
);
break
;
default
:
// suppress warnings
break
;
}
...
...
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