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
3827f495
Commit
3827f495
authored
Jan 31, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ratsnest color is saved in RENDER_SETTINGS. Temporary ratsnest is drawn using a brightened color.
parent
5fea60d2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
color4d.h
include/gal/color4d.h
+1
-1
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+1
-0
ratsnest_viewitem.cpp
pcbnew/ratsnest_viewitem.cpp
+8
-2
No files found.
include/gal/color4d.h
View file @
3827f495
...
@@ -136,7 +136,7 @@ public:
...
@@ -136,7 +136,7 @@ public:
* Function Brightened
* Function Brightened
* Returns a color that is brighter by a given factor, without modifying object.
* Returns a color that is brighter by a given factor, without modifying object.
* @param aFactor Specifies how bright the color should become (valid values: 0.0 .. 1.0).
* @param aFactor Specifies how bright the color should become (valid values: 0.0 .. 1.0).
* @return COLOR4D Highlighted
d
color.
* @return COLOR4D Highlighted color.
*/
*/
COLOR4D
Brightened
(
double
aFactor
)
const
COLOR4D
Brightened
(
double
aFactor
)
const
{
{
...
...
pcbnew/pcb_painter.cpp
View file @
3827f495
...
@@ -75,6 +75,7 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings
...
@@ -75,6 +75,7 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings
m_layerColors
[
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
PAD_FR_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
PAD_FR_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
PAD_BK_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
PAD_BK_NETNAMES_VISIBLE
)]
=
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
RATSNEST_VISIBLE
)]
=
COLOR4D
(
0.4
,
0.4
,
0.4
,
0.7
);
m_layerColors
[
ITEM_GAL_LAYER
(
WORKSHEET
)]
=
COLOR4D
(
0.5
,
0.0
,
0.0
,
1.0
);
m_layerColors
[
ITEM_GAL_LAYER
(
WORKSHEET
)]
=
COLOR4D
(
0.5
,
0.0
,
0.0
,
1.0
);
// Netnames for copper layers
// Netnames for copper layers
...
...
pcbnew/ratsnest_viewitem.cpp
View file @
3827f495
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <ratsnest_viewitem.h>
#include <ratsnest_viewitem.h>
#include <ratsnest_data.h>
#include <ratsnest_data.h>
#include <gal/graphics_abstraction_layer.h>
#include <gal/graphics_abstraction_layer.h>
#include <pcb_painter.h>
#include <layers_id_colors_and_visibility.h>
#include <layers_id_colors_and_visibility.h>
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
...
@@ -57,9 +58,9 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
...
@@ -57,9 +58,9 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsFill
(
false
);
aGal
->
SetIsFill
(
false
);
aGal
->
SetLineWidth
(
1.0
);
aGal
->
SetLineWidth
(
1.0
);
aGal
->
SetStrokeColor
(
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.2
)
);
RENDER_SETTINGS
*
rs
=
m_view
->
GetPainter
()
->
GetSettings
();
COLOR4D
color
=
rs
->
GetColor
(
NULL
,
ITEM_GAL_LAYER
(
RATSNEST_VISIBLE
)
);
// Draw the temporary ratsnest (skip the unconnected net [net code == 0])
for
(
int
i
=
1
;
i
<
m_data
->
GetNetCount
();
++
i
)
for
(
int
i
=
1
;
i
<
m_data
->
GetNetCount
();
++
i
)
{
{
const
RN_NET
&
net
=
m_data
->
GetNet
(
i
);
const
RN_NET
&
net
=
m_data
->
GetNet
(
i
);
...
@@ -70,6 +71,9 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
...
@@ -70,6 +71,9 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
// Avoid duplicate destinations for ratsnest lines by storing already used nodes
// Avoid duplicate destinations for ratsnest lines by storing already used nodes
boost
::
unordered_set
<
RN_NODE_PTR
>
usedDestinations
;
boost
::
unordered_set
<
RN_NODE_PTR
>
usedDestinations
;
// Set brighter color for the temporary ratsnest
aGal
->
SetStrokeColor
(
color
.
Brightened
(
0.8
)
);
// Draw the "dynamic" ratsnest (ie. for objects that may be currently being moved)
// Draw the "dynamic" ratsnest (ie. for objects that may be currently being moved)
BOOST_FOREACH
(
const
RN_NODE_PTR
&
node
,
net
.
GetSimpleNodes
()
)
BOOST_FOREACH
(
const
RN_NODE_PTR
&
node
,
net
.
GetSimpleNodes
()
)
{
{
...
@@ -86,6 +90,8 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
...
@@ -86,6 +90,8 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
}
}
// Draw the "static" ratsnest
// Draw the "static" ratsnest
aGal
->
SetStrokeColor
(
color
);
// using the default ratsnest color
const
std
::
vector
<
RN_EDGE_PTR
>*
edges
=
net
.
GetUnconnected
();
const
std
::
vector
<
RN_EDGE_PTR
>*
edges
=
net
.
GetUnconnected
();
if
(
edges
==
NULL
)
if
(
edges
==
NULL
)
continue
;
continue
;
...
...
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