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
2fe85cf4
Commit
2fe85cf4
authored
Feb 03, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes.
parent
864c8606
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+6
-5
pcb_painter.h
pcbnew/pcb_painter.h
+1
-0
No files found.
pcbnew/pcb_painter.cpp
View file @
2fe85cf4
...
...
@@ -261,13 +261,14 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
VECTOR2D
start
(
aTrack
->
GetStart
()
);
VECTOR2D
end
(
aTrack
->
GetEnd
()
);
int
width
=
aTrack
->
GetWidth
();
int
netNumber
=
aTrack
->
GetNet
();
COLOR4D
color
;
if
(
m_pcbSettings
->
m_netNamesOnTracks
&&
IsNetnameLayer
(
aLayer
)
)
{
int
netCode
=
aTrack
->
GetNet
();
// If there is a net name - display it on the track
if
(
net
Number
>
0
)
if
(
net
Code
>
0
)
{
VECTOR2D
line
=
(
end
-
start
);
double
length
=
line
.
EuclideanNorm
();
...
...
@@ -276,11 +277,11 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
if
(
length
<
10
*
width
)
return
;
NETINFO_ITEM
*
net
=
(
(
BOARD
*
)
aTrack
->
GetParent
()
)
->
FindNet
(
net
Number
);
NETINFO_ITEM
*
net
=
(
(
BOARD
*
)
aTrack
->
GetParent
()
)
->
FindNet
(
net
Code
);
if
(
!
net
)
return
;
std
::
wstring
netName
=
std
::
wstring
(
net
->
GetShortNetname
().
wc_str
()
);
wxString
netName
=
net
->
GetShortNetname
(
);
VECTOR2D
textPosition
=
start
+
line
/
2.0
;
// center of the track
double
textOrientation
=
-
atan
(
line
.
y
/
line
.
x
);
double
textSize
=
std
::
min
(
static_cast
<
double
>
(
width
),
length
/
netName
.
length
()
);
...
...
@@ -304,7 +305,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
m_gal
->
StrokeText
(
netName
,
textPosition
,
textOrientation
);
}
}
else
if
(
IsCopperLayer
(
aLayer
))
else
if
(
IsCopperLayer
(
aLayer
)
)
{
// Draw a regular track
color
=
m_pcbSettings
->
GetColor
(
aTrack
,
aLayer
);
...
...
pcbnew/pcb_painter.h
View file @
2fe85cf4
...
...
@@ -114,6 +114,7 @@ protected:
///> Colors for all layers (darkened)
COLOR4D
m_layerColorsDark
[
TOTAL_LAYER_COUNT
];
///> Flag determining if items on a given layer should be drawn as an outline or a full item
bool
m_sketchModeSelect
[
TOTAL_LAYER_COUNT
];
///> Flag determining if pad numbers should be visible
...
...
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