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
e04b6a04
Commit
e04b6a04
authored
Apr 07, 2013
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the boundary of the object and not just the boundary of the text in SCH_TEXT hit testing.
parent
b739b2b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
24 deletions
+10
-24
sch_text.cpp
eeschema/sch_text.cpp
+10
-18
sch_text.h
eeschema/sch_text.h
+0
-6
No files found.
eeschema/sch_text.cpp
View file @
e04b6a04
...
@@ -643,13 +643,21 @@ void SCH_TEXT::GetNetListItem( vector<NETLIST_OBJECT*>& aNetListItems,
...
@@ -643,13 +643,21 @@ void SCH_TEXT::GetNetListItem( vector<NETLIST_OBJECT*>& aNetListItems,
bool
SCH_TEXT
::
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
bool
SCH_TEXT
::
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
{
{
return
TextHitTest
(
aPosition
,
aAccuracy
);
EDA_RECT
bBox
=
GetBoundingBox
();
bBox
.
Inflate
(
aAccuracy
);
return
bBox
.
Contains
(
aPosition
);
}
}
bool
SCH_TEXT
::
HitTest
(
const
EDA_RECT
&
aRect
,
bool
aContained
,
int
aAccuracy
)
const
bool
SCH_TEXT
::
HitTest
(
const
EDA_RECT
&
aRect
,
bool
aContained
,
int
aAccuracy
)
const
{
{
return
TextHitTest
(
aRect
,
aContained
,
aAccuracy
);
EDA_RECT
bBox
=
GetBoundingBox
();
bBox
.
Inflate
(
aAccuracy
);
if
(
aContained
)
return
aRect
.
Contains
(
bBox
);
return
aRect
.
Intersects
(
bBox
);
}
}
...
@@ -1019,11 +1027,6 @@ wxString SCH_LABEL::GetSelectMenuText() const
...
@@ -1019,11 +1027,6 @@ wxString SCH_LABEL::GetSelectMenuText() const
}
}
bool
SCH_LABEL
::
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
{
return
TextHitTest
(
aPosition
,
aAccuracy
);
}
SCH_GLOBALLABEL
::
SCH_GLOBALLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_GLOBALLABEL
::
SCH_GLOBALLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
SCH_GLOBAL_LABEL_T
)
SCH_TEXT
(
pos
,
text
,
SCH_GLOBAL_LABEL_T
)
...
@@ -1454,11 +1457,6 @@ wxString SCH_GLOBALLABEL::GetSelectMenuText() const
...
@@ -1454,11 +1457,6 @@ wxString SCH_GLOBALLABEL::GetSelectMenuText() const
}
}
bool
SCH_GLOBALLABEL
::
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
{
return
TextHitTest
(
aPosition
,
aAccuracy
);
}
SCH_HIERLABEL
::
SCH_HIERLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
,
KICAD_T
aType
)
:
SCH_HIERLABEL
::
SCH_HIERLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
,
KICAD_T
aType
)
:
SCH_TEXT
(
pos
,
text
,
aType
)
SCH_TEXT
(
pos
,
text
,
aType
)
...
@@ -1802,9 +1800,3 @@ wxString SCH_HIERLABEL::GetSelectMenuText() const
...
@@ -1802,9 +1800,3 @@ wxString SCH_HIERLABEL::GetSelectMenuText() const
msg
.
Printf
(
_
(
"Hierarchical Label %s"
),
GetChars
(
tmp
)
);
msg
.
Printf
(
_
(
"Hierarchical Label %s"
),
GetChars
(
tmp
)
);
return
msg
;
return
msg
;
}
}
bool
SCH_HIERLABEL
::
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
{
return
TextHitTest
(
aPosition
,
aAccuracy
);
}
eeschema/sch_text.h
View file @
e04b6a04
...
@@ -262,8 +262,6 @@ public:
...
@@ -262,8 +262,6 @@ public:
bool
IsReplaceable
()
const
{
return
true
;
}
bool
IsReplaceable
()
const
{
return
true
;
}
bool
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
;
EDA_ITEM
*
Clone
()
const
;
EDA_ITEM
*
Clone
()
const
;
private
:
private
:
...
@@ -315,8 +313,6 @@ public:
...
@@ -315,8 +313,6 @@ public:
BITMAP_DEF
GetMenuImage
()
const
{
return
add_glabel_xpm
;
}
BITMAP_DEF
GetMenuImage
()
const
{
return
add_glabel_xpm
;
}
bool
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
;
EDA_ITEM
*
Clone
()
const
;
EDA_ITEM
*
Clone
()
const
;
private
:
private
:
...
@@ -370,8 +366,6 @@ public:
...
@@ -370,8 +366,6 @@ public:
BITMAP_DEF
GetMenuImage
()
const
{
return
add_hierarchical_label_xpm
;
}
BITMAP_DEF
GetMenuImage
()
const
{
return
add_hierarchical_label_xpm
;
}
bool
HitTest
(
const
wxPoint
&
aPosition
,
int
aAccuracy
)
const
;
EDA_ITEM
*
Clone
()
const
;
EDA_ITEM
*
Clone
()
const
;
private
:
private
:
...
...
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