Skip to content

Commit

Permalink
Draw segment strokeCap based on edgeStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
xqwzts committed May 9, 2018
1 parent de9f371 commit c8bbc3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ void _paintChart(Canvas canvas, Size size, CircularChart chart) {
final Paint segmentPaint = new Paint()
..style = chart.chartType == CircularChartType.Radial
? PaintingStyle.stroke
: PaintingStyle.fill;
: PaintingStyle.fill
..strokeCap = chart.edgeStyle == SegmentEdgeStyle.Round
? StrokeCap.round
: StrokeCap.butt;

for (final CircularChartStack stack in chart.stacks) {
for (final segment in stack.segments) {
segmentPaint.color = segment.color;
segmentPaint.strokeWidth = stack.width;

canvas.drawArc(
new Rect.fromCircle(
center: new Offset(size.width / 2, size.height / 2),
Expand Down

0 comments on commit c8bbc3f

Please sign in to comment.