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
0e709a12
Commit
0e709a12
authored
Mar 13, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added bool Intersects()
parent
8bfdd040
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
40 deletions
+57
-40
base_struct.cpp
common/base_struct.cpp
+57
-40
No files found.
common/base_struct.cpp
View file @
0e709a12
...
...
@@ -697,6 +697,23 @@ bool EDA_Rect::Inside( const wxPoint& point )
}
bool
EDA_Rect
::
Intersects
(
const
EDA_Rect
aRect
)
const
{
// this logic taken from wxWidgets' geometry.cpp file:
int
left
=
MAX
(
m_Pos
.
x
,
aRect
.
m_Pos
.
x
);
int
right
=
MIN
(
m_Pos
.
x
+
m_Size
.
x
,
aRect
.
m_Pos
.
x
+
aRect
.
m_Size
.
x
);
int
top
=
MAX
(
m_Pos
.
y
,
aRect
.
m_Pos
.
y
);
int
bottom
=
MIN
(
m_Pos
.
y
+
m_Size
.
y
,
aRect
.
m_Pos
.
y
+
aRect
.
m_Size
.
y
);
if
(
left
<
right
&&
top
<
bottom
)
{
return
true
;
}
return
false
;
}
/**************************************************/
EDA_Rect
&
EDA_Rect
::
Inflate
(
wxCoord
dx
,
wxCoord
dy
)
/**************************************************/
...
...
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