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
9e4fe8b4
Commit
9e4fe8b4
authored
Jul 01, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Faster polylines drawing using OpenGL backend.
Fixed drawing of lines' caps.
parent
4360860b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
opengl_gal.cpp
common/gal/opengl/opengl_gal.cpp
+13
-2
No files found.
common/gal/opengl/opengl_gal.cpp
View file @
9e4fe8b4
...
...
@@ -714,7 +714,7 @@ void OPENGL_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoin
// Line caps
drawFilledSemiCircle
(
aStartPoint
,
lineWidth
/
2
,
lineAngle
+
M_PI
/
2
);
drawFilledSemiCircle
(
aEndPoint
,
lineWidth
/
2
,
lineAngle
+
M_PI
/
2
);
drawFilledSemiCircle
(
aEndPoint
,
lineWidth
/
2
,
lineAngle
-
M_PI
/
2
);
}
...
...
@@ -725,8 +725,19 @@ void OPENGL_GAL::DrawPolyline( std::deque<VECTOR2D>& aPointList )
// Start from the second point
for
(
it
++
;
it
!=
aPointList
.
end
();
it
++
)
{
DrawLine
(
*
(
it
-
1
),
*
it
);
const
VECTOR2D
startEndVector
=
(
*
it
-
*
(
it
-
1
)
);
double
lineAngle
=
startEndVector
.
Angle
();
drawLineQuad
(
*
(
it
-
1
),
*
it
);
// There is no need to draw line caps on both ends of polyline's segments
drawFilledSemiCircle
(
*
(
it
-
1
),
lineWidth
/
2
,
lineAngle
+
M_PI
/
2
);
}
// ..and now - draw the ending cap
const
VECTOR2D
startEndVector
=
(
*
(
it
-
1
)
-
*
(
it
-
2
)
);
double
lineAngle
=
startEndVector
.
Angle
();
drawFilledSemiCircle
(
*
(
it
-
1
),
lineWidth
/
2
,
lineAngle
-
M_PI
/
2
);
}
...
...
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