From c8bbc3f8c19e23c08cf359d0ed39a0b25d432dc8 Mon Sep 17 00:00:00 2001 From: Victor Choueiri Date: Wed, 9 May 2018 21:25:29 +0300 Subject: [PATCH] Draw segment strokeCap based on edgeStyle --- lib/src/painter.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/painter.dart b/lib/src/painter.dart index fa6d971..1d81ddb 100644 --- a/lib/src/painter.dart +++ b/lib/src/painter.dart @@ -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),