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
188ea1f5
Commit
188ea1f5
authored
Apr 17, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More accurate rendering display of ZONE_CONTAINERs.
parent
71a1ad6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
14 deletions
+28
-14
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+28
-14
No files found.
pcbnew/pcb_painter.cpp
View file @
188ea1f5
...
@@ -495,21 +495,29 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
...
@@ -495,21 +495,29 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
void
PCB_PAINTER
::
draw
(
const
ZONE_CONTAINER
*
aContainer
)
void
PCB_PAINTER
::
draw
(
const
ZONE_CONTAINER
*
aContainer
)
{
{
std
::
vector
<
CPolyPt
>
polyPoints
=
aContainer
->
GetFilledPolysList
();
if
(
polyPoints
.
size
()
==
0
)
// Nothing to draw
return
;
COLOR4D
fillColor
=
getLayerColor
(
aContainer
->
GetLayer
(),
aContainer
->
GetNet
()
);
COLOR4D
fillColor
=
getLayerColor
(
aContainer
->
GetLayer
(),
aContainer
->
GetNet
()
);
std
::
vector
<
CPolyPt
>::
iterator
polyIterator
;
std
::
vector
<
CPolyPt
>::
iterator
polyIterator
;
std
::
vector
<
CPolyPt
>
polyPoints
=
aContainer
->
GetFilledPolysList
();
std
::
deque
<
VECTOR2D
>
corners
;
std
::
deque
<
VECTOR2D
>
corners
;
VECTOR2D
startPoint
;
int
fillMode
=
aContainer
->
GetFillMode
();
m_gal
->
SetLineCap
(
LINE_CAP_BUTT
);
m_gal
->
SetLineJoin
(
LINE_JOIN_ROUND
);
m_gal
->
SetFillColor
(
fillColor
);
m_gal
->
SetFillColor
(
fillColor
);
m_gal
->
SetStrokeColor
(
fillColor
);
m_gal
->
SetStrokeColor
(
fillColor
);
m_gal
->
SetIsFill
(
aContainer
->
IsFilled
()
);
m_gal
->
SetIsFill
(
!
fillMode
);
m_gal
->
SetIsStroke
(
true
);
m_gal
->
SetIsStroke
(
true
);
m_gal
->
SetLineWidth
(
aContainer
->
GetThermalReliefCopperBridge
()
/
2.0
);
m_gal
->
SetLineWidth
(
aContainer
->
GetThermalReliefCopperBridge
()
/
2.0
);
m_gal
->
SetLineCap
(
LINE_CAP_ROUND
);
m_gal
->
SetLineJoin
(
LINE_JOIN_ROUND
);
// FIXME implement hatch mode
// FIXME implement hatch mode
if
(
fillMode
==
0
)
{
startPoint
=
VECTOR2D
(
polyPoints
.
front
()
);
for
(
polyIterator
=
polyPoints
.
begin
();
polyIterator
!=
polyPoints
.
end
();
polyIterator
++
)
for
(
polyIterator
=
polyPoints
.
begin
();
polyIterator
!=
polyPoints
.
end
();
polyIterator
++
)
{
{
// Find out all of polygons and then draw them
// Find out all of polygons and then draw them
...
@@ -520,10 +528,16 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aContainer )
...
@@ -520,10 +528,16 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aContainer )
else
else
{
{
m_gal
->
DrawPolygon
(
corners
);
m_gal
->
DrawPolygon
(
corners
);
// Closing point for polyline
corners
.
push_back
(
VECTOR2D
(
startPoint
)
);
m_gal
->
DrawPolyline
(
corners
);
m_gal
->
DrawPolyline
(
corners
);
startPoint
=
VECTOR2D
(
*
(
polyIterator
+
1
)
);
corners
.
clear
();
corners
.
clear
();
}
}
}
}
}
}
}
...
...
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