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
a853fb11
Commit
a853fb11
authored
Mar 30, 2008
by
diemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GetBoundingBox() for SCH_GLOBALLABEL and SCH_HIERLABEL.
parent
c86da05a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
0 deletions
+106
-0
class_text-label.cpp
eeschema/class_text-label.cpp
+102
-0
class_text-label.h
eeschema/class_text-label.h
+4
-0
No files found.
eeschema/class_text-label.cpp
View file @
a853fb11
...
...
@@ -305,6 +305,56 @@ void SCH_HIERLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
}
}
EDA_Rect
SCH_HIERLABEL
::
GetBoundingBox
()
{
int
x
,
y
,
dx
,
dy
,
dangle
,
length
,
height
;
x
=
m_Pos
.
x
;
y
=
m_Pos
.
y
;
if
(
m_IsDangling
)
dangle
=
DANGLING_SYMBOL_SIZE
;
else
dangle
=
0
;
height
=
m_Size
.
y
+
2
*
TXTMARGE
;
length
=
(
Pitch
()
*
GetLength
()
)
+
height
+
2
*
dangle
;
// add height for triangular shapes
switch
(
m_Orient
)
// respect orientation
{
case
0
:
/* Horiz Normal Orientation (left justified) */
dx
=
-
length
;
dy
=
height
;
x
+=
dangle
;
y
-=
height
/
2
;
break
;
case
1
:
/* Vert Orientation UP */
dx
=
height
;
dy
=
length
;
x
-=
height
/
2
;
y
-=
dangle
;
break
;
case
2
:
/* Horiz Orientation - Right justified */
dx
=
length
;
dy
=
height
;
x
-=
dangle
;
y
-=
height
/
2
;
break
;
case
3
:
/* Vert Orientation BOTTOM */
dx
=
height
;
dy
=
-
length
;
x
-=
height
/
2
;
y
+=
dangle
;
break
;
}
EDA_Rect
box
(
wxPoint
(
x
,
y
),
wxSize
(
dx
,
dy
)
);
box
.
Normalize
();
return
box
;
}
/*******************************************************************************************/
void
SCH_GLOBALLABEL
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
draw_offset
,
...
...
@@ -469,6 +519,58 @@ void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
}
EDA_Rect
SCH_GLOBALLABEL
::
GetBoundingBox
()
{
int
x
,
y
,
dx
,
dy
,
dangle
,
length
,
height
;
x
=
m_Pos
.
x
;
y
=
m_Pos
.
y
;
if
(
m_IsDangling
)
dangle
=
DANGLING_SYMBOL_SIZE
;
else
dangle
=
0
;
height
=
m_Size
.
y
+
2
*
TXTMARGE
;
length
=
(
Pitch
()
*
GetLength
()
)
+
2
*
height
+
2
*
dangle
;
// add 2*height for triangular shapes (bidirectional)
switch
(
m_Orient
)
// respect orientation
{
case
0
:
/* Horiz Normal Orientation (left justified) */
dx
=
-
length
;
dy
=
height
;
x
+=
dangle
;
y
-=
height
/
2
;
break
;
case
1
:
/* Vert Orientation UP */
dx
=
height
;
dy
=
length
;
x
-=
height
/
2
;
y
-=
dangle
;
break
;
case
2
:
/* Horiz Orientation - Right justified */
dx
=
length
;
dy
=
height
;
x
-=
dangle
;
y
-=
height
/
2
;
break
;
case
3
:
/* Vert Orientation BOTTOM */
dx
=
height
;
dy
=
-
length
;
x
-=
height
/
2
;
y
+=
dangle
;
break
;
}
EDA_Rect
box
(
wxPoint
(
x
,
y
),
wxSize
(
dx
,
dy
)
);
box
.
Normalize
();
return
box
;
}
EDA_Rect
SCH_TEXT
::
GetBoundingBox
()
{
int
x
,
y
,
dx
,
dy
,
dangle
,
length
,
height
;
...
...
eeschema/class_text-label.h
View file @
a853fb11
...
...
@@ -144,6 +144,8 @@ public:
* <corner_count>, x0, y0, ... xn, yn
*/
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
EDA_Rect
GetBoundingBox
();
};
...
...
@@ -171,6 +173,8 @@ public:
* <corner_count>, x0, y0, ... xn, yn
*/
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
EDA_Rect
GetBoundingBox
();
};
#endif
/* CLASS_TEXT_LABEL_H */
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