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
e3c4f425
Commit
e3c4f425
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wrong reference point for copied items in subsequent module editor invocations (GAL).
parent
ac8ee56e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
loadcmp.cpp
pcbnew/loadcmp.cpp
+1
-0
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+6
-4
No files found.
pcbnew/loadcmp.cpp
View file @
e3c4f425
...
...
@@ -107,6 +107,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
PlaceModule
(
newModule
,
NULL
);
newModule
->
SetPosition
(
wxPoint
(
0
,
0
)
);
// cursor in GAL may not be initialized at the moment
// Put it on FRONT layer,
// because this is the default in ModEdit, and in libs
...
...
pcbnew/tools/edit_tool.cpp
View file @
e3c4f425
...
...
@@ -453,7 +453,7 @@ int EDIT_TOOL::CopyItems( TOOL_EVENT& aEvent )
frame
->
DisplayToolMsg
(
_
(
"Select reference point"
)
);
bool
cancelled
=
false
;
VECTOR2I
cursorPos
;
VECTOR2I
cursorPos
=
getViewControls
()
->
GetCursorPosition
()
;
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
{
...
...
@@ -490,8 +490,10 @@ int EDIT_TOOL::CopyItems( TOOL_EVENT& aEvent )
module
.
Add
(
clone
);
}
// Set the new relative internal local coordinates of footprint items
wxPoint
moveVector
=
module
.
GetPosition
()
-
wxPoint
(
cursorPos
.
x
,
cursorPos
.
y
);
// Set the new relative internal local coordinates of copied items
MODULE
*
editedModule
=
getModel
<
BOARD
>
()
->
m_Modules
;
wxPoint
moveVector
=
module
.
GetPosition
()
+
editedModule
->
GetPosition
()
-
wxPoint
(
cursorPos
.
x
,
cursorPos
.
y
);
module
.
MoveAnchorPosition
(
moveVector
);
io
.
Format
(
&
module
,
0
);
...
...
@@ -499,7 +501,7 @@ int EDIT_TOOL::CopyItems( TOOL_EVENT& aEvent )
m_toolMgr
->
SaveClipboard
(
data
);
}
frame
->
DisplayToolMsg
(
wxString
::
Format
(
_
(
"Copied %d item
s
"
),
selection
.
Size
()
)
);
frame
->
DisplayToolMsg
(
wxString
::
Format
(
_
(
"Copied %d item
(s)
"
),
selection
.
Size
()
)
);
controls
->
SetSnapping
(
false
);
controls
->
ShowCursor
(
false
);
controls
->
SetAutoPan
(
false
);
...
...
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