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
81b6cbcb
Commit
81b6cbcb
authored
Mar 27, 2008
by
diemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added GetBoundingBox for SCH_TEXT. Beatufication.
parent
dbb69b75
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
class_text-label.cpp
eeschema/class_text-label.cpp
+51
-0
class_text-label.h
eeschema/class_text-label.h
+2
-1
component_class.h
eeschema/component_class.h
+1
-1
No files found.
eeschema/class_text-label.cpp
View file @
81b6cbcb
...
...
@@ -467,3 +467,54 @@ void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
corner_list
[
12
]
=
corner_list
[
0
];
corner_list
[
13
]
=
corner_list
[
1
];
// closing
}
EDA_Rect
SCH_TEXT
::
GetBoundingBox
()
{
int
x
,
y
,
dx
,
dy
,
dangle
,
length
,
height
;
x
=
m_Pos
.
x
;
y
=
m_Pos
.
y
;
length
=
(
Pitch
()
*
GetLength
()
);
height
=
m_Size
.
y
;
if
(
m_IsDangling
)
dangle
=
DANGLING_SYMBOL_SIZE
;
else
dangle
=
0
;
switch
(
m_Orient
)
// respect orientation
{
case
0
:
/* Horiz Normal Orientation (left justified) */
dx
=
2
*
dangle
+
length
;
dy
=
-
2
*
dangle
-
height
-
TXTMARGE
;
x
-=
dangle
;
y
+=
dangle
;
break
;
case
1
:
/* Vert Orientation UP */
dx
=
-
2
*
dangle
-
height
-
TXTMARGE
;
dy
=
-
2
*
dangle
-
length
;
x
+=
dangle
;
y
+=
dangle
;
break
;
case
2
:
/* Horiz Orientation - Right justified */
dx
=
-
2
*
dangle
-
length
;
dy
=
-
2
*
dangle
-
height
-
TXTMARGE
;
x
+=
dangle
;
y
+=
dangle
;
break
;
case
3
:
/* Vert Orientation BOTTOM */
dx
=
-
2
*
dangle
-
height
-
TXTMARGE
;
dy
=
2
*
dangle
+
length
;
x
+=
dangle
;
y
-=
dangle
;
break
;
}
EDA_Rect
box
(
wxPoint
(
x
,
y
),
wxSize
(
dx
,
dy
)
);
box
.
Normalize
();
return
box
;
}
eeschema/class_text-label.h
View file @
81b6cbcb
...
...
@@ -82,7 +82,7 @@ class SCH_TEXT : public SCH_ITEM
public
:
int
m_Layer
;
int
m_Shape
;
bool
m_IsDangling
;
// TRUE
si non connect�
bool
m_IsDangling
;
// TRUE
if not connected
public
:
SCH_TEXT
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
const
wxString
&
text
=
wxEmptyString
,
...
...
@@ -102,6 +102,7 @@ public:
void
SwapData
(
SCH_TEXT
*
copyitem
);
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
EDA_Rect
GetBoundingBox
();
};
...
...
eeschema/component_class.h
View file @
81b6cbcb
...
...
@@ -52,7 +52,7 @@ public:
virtual
wxString
GetClass
()
const
{
return
wxT
(
"PartText"
);
return
wxT
(
"PartText
Struct
"
);
}
...
...
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