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
5ac6579a
Commit
5ac6579a
authored
Mar 10, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cursor snaps to EDIT_POINTs.
Added POINT_EDITOR::isModified().
parent
ecb3aebc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
edit_points.h
pcbnew/tools/edit_points.h
+1
-1
point_editor.cpp
pcbnew/tools/point_editor.cpp
+6
-4
point_editor.h
pcbnew/tools/point_editor.h
+6
-0
No files found.
pcbnew/tools/edit_points.h
View file @
5ac6579a
...
...
@@ -456,7 +456,7 @@ public:
* @param aConstrained is the point that is put under constrain.
* @param aConstrainer is the point that is the source of the constrain.
*/
EPC_45DEGREE
(
EDIT_POINT
&
aConstrained
,
const
EDIT_POINT
&
aConstrainer
)
:
EPC_45DEGREE
(
EDIT_POINT
&
aConstrained
,
const
EDIT_POINT
&
aConstrainer
)
:
EDIT_POINT_CONSTRAINT
(
aConstrained
),
m_constrainer
(
aConstrainer
)
{}
...
...
pcbnew/tools/point_editor.cpp
View file @
5ac6579a
...
...
@@ -62,7 +62,6 @@ public:
case
S_SEGMENT
:
points
->
AddPoint
(
segment
->
GetStart
()
);
points
->
AddPoint
(
segment
->
GetEnd
()
);
break
;
case
S_ARC
:
...
...
@@ -194,12 +193,14 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
controls
->
ShowCursor
(
true
);
controls
->
SetAutoPan
(
true
);
controls
->
SetSnapping
(
true
);
controls
->
ForceCursorPosition
(
true
,
point
->
GetPosition
()
);
}
else
{
controls
->
ShowCursor
(
false
);
controls
->
SetAutoPan
(
false
);
controls
->
SetSnapping
(
false
);
controls
->
ForceCursorPosition
(
false
);
}
}
...
...
@@ -213,6 +214,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
// Save items, so changes can be undone
editFrame
->
OnModify
();
editFrame
->
SaveCopyInUndoList
(
selection
.
items
,
UR_CHANGED
);
controls
->
ForceCursorPosition
(
false
);
modified
=
true
;
}
...
...
@@ -299,11 +301,11 @@ void POINT_EDITOR::updateItem() const
switch
(
segment
->
GetShape
()
)
{
case
S_SEGMENT
:
if
(
&
(
*
m_editPoints
)[
0
]
==
m_dragPoint
)
if
(
isModified
(
(
*
m_editPoints
)[
0
]
)
)
segment
->
SetStart
(
wxPoint
(
(
*
m_editPoints
)[
0
].
GetPosition
().
x
,
(
*
m_editPoints
)[
0
].
GetPosition
().
y
)
);
else
if
(
&
(
*
m_editPoints
)[
1
]
==
m_dragPoint
)
else
if
(
isModified
(
(
*
m_editPoints
)[
1
]
)
)
segment
->
SetEnd
(
wxPoint
(
(
*
m_editPoints
)[
1
].
GetPosition
().
x
,
(
*
m_editPoints
)[
1
].
GetPosition
().
y
)
);
...
...
@@ -351,7 +353,7 @@ void POINT_EDITOR::updateItem() const
const
VECTOR2I
&
center
=
(
*
m_editPoints
)[
0
].
GetPosition
();
const
VECTOR2I
&
end
=
(
*
m_editPoints
)[
1
].
GetPosition
();
if
(
m_dragPoint
==
&
(
*
m_editPoints
)[
0
]
)
if
(
isModified
(
(
*
m_editPoints
)[
0
]
)
)
{
wxPoint
moveVector
=
wxPoint
(
center
.
x
,
center
.
y
)
-
segment
->
GetCenter
();
segment
->
Move
(
moveVector
);
...
...
pcbnew/tools/point_editor.h
View file @
5ac6579a
...
...
@@ -74,6 +74,12 @@ private:
///> Updates edit points with item's points.
void
updatePoints
()
const
;
///> Returns true if aPoint is the currently modified point.
inline
bool
isModified
(
const
EDIT_POINT
&
aPoint
)
const
{
return
m_dragPoint
==
&
aPoint
;
}
///> Returns a point that should be used as a constrainer for 45 degrees mode.
EDIT_POINT
get45DegConstrainer
()
const
;
...
...
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