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
a9031edc
Commit
a9031edc
authored
Feb 05, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grip margin is relative to the world's zoom.
parent
f9225339
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+3
-4
No files found.
pcbnew/tools/selection_tool.cpp
View file @
a9031edc
...
...
@@ -568,16 +568,15 @@ void SELECTION_TOOL::deselectVisually( BOARD_ITEM* aItem ) const
bool
SELECTION_TOOL
::
containsSelected
(
const
VECTOR2I
&
aPoint
)
const
{
const
unsigned
GRIP_MARGIN
=
500000
;
const
unsigned
GRIP_MARGIN
=
20
;
VECTOR2D
margin
=
getView
()
->
ToWorld
(
VECTOR2D
(
GRIP_MARGIN
,
GRIP_MARGIN
),
false
);
// Check if the point is located within any of the currently selected items bounding boxes
std
::
set
<
BOARD_ITEM
*>::
iterator
it
,
it_end
;
for
(
unsigned
int
i
=
0
;
i
<
m_selection
.
items
.
GetCount
();
++
i
)
{
BOARD_ITEM
*
item
=
static_cast
<
BOARD_ITEM
*>
(
m_selection
.
items
.
GetPickedItem
(
i
)
);
BOX2I
itemBox
=
item
->
ViewBBox
();
itemBox
.
Inflate
(
GRIP_MARGIN
);
// Give some margin for gripping an item
itemBox
.
Inflate
(
margin
.
x
,
margin
.
y
);
// Give some margin for gripping an item
if
(
itemBox
.
Contains
(
aPoint
)
)
return
true
;
...
...
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