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
382c6bd2
Commit
382c6bd2
authored
Sep 12, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move tool is activated when drag event starts nearby selected items.
parent
b04de0ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+23
-3
No files found.
pcbnew/tools/selection_tool.cpp
View file @
382c6bd2
...
...
@@ -111,8 +111,28 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
}
else
{
// Now user wants to drag the selected items
m_toolMgr
->
InvokeTool
(
"pcbnew.InteractiveMove"
);
bool
runTool
=
false
;
// Check if dragging event started within the currently selected items bounding box
std
::
set
<
BOARD_ITEM
*>::
iterator
it
,
it_end
;
for
(
it
=
m_selectedItems
.
begin
(),
it_end
=
m_selectedItems
.
end
();
it
!=
it_end
;
++
it
)
{
BOX2I
itemBox
=
(
*
it
)
->
ViewBBox
();
itemBox
.
Inflate
(
500000
);
// Give some margin for gripping an item
if
(
itemBox
.
Contains
(
evt
->
Position
()
)
)
{
// Click event occurred within a selected item bounding box
// -> user wants to drag selected items
runTool
=
true
;
break
;
}
}
if
(
runTool
)
m_toolMgr
->
InvokeTool
(
"pcbnew.InteractiveMove"
);
else
clearSelection
();
}
}
else
if
(
dragging
)
...
...
@@ -131,7 +151,7 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
void
SELECTION_TOOL
::
toggleSelection
(
BOARD_ITEM
*
aItem
)
{
if
(
m_selectedItems
.
find
(
aItem
)
!=
m_selectedItems
.
en
d
()
)
if
(
aItem
->
IsSelecte
d
()
)
{
aItem
->
ClearSelected
();
m_selectedItems
.
erase
(
aItem
);
...
...
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