From e7a4125d1d2ae693915d05cd6cbb3c3bc4c41101 Mon Sep 17 00:00:00 2001 From: Ahmed-gubara Date: Tue, 6 Apr 2021 14:37:12 +0200 Subject: [PATCH] fix polyline border drawing --- lib/src/layer/polyline_layer.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/src/layer/polyline_layer.dart b/lib/src/layer/polyline_layer.dart index 8ab7ff5de..30c68bc03 100644 --- a/lib/src/layer/polyline_layer.dart +++ b/lib/src/layer/polyline_layer.dart @@ -174,7 +174,7 @@ class PolylinePainter extends CustomPainter { if (polylineOpt.isDotted) { var spacing = polylineOpt.strokeWidth * 1.5; canvas.saveLayer(rect, Paint()); - if (borderPaint != null) { + if (borderPaint != null && filterPaint != null) { _paintDottedLine( canvas, polylineOpt.offsets, borderRadius, spacing, borderPaint); _paintDottedLine( @@ -185,12 +185,10 @@ class PolylinePainter extends CustomPainter { } else { paint.style = PaintingStyle.stroke; canvas.saveLayer(rect, Paint()); - if (borderPaint != null) { - if (filterPaint != null) { - filterPaint.style = PaintingStyle.stroke; - _paintLine(canvas, polylineOpt.offsets, borderPaint); - } - borderPaint?.style = PaintingStyle.stroke; + if (borderPaint != null && filterPaint != null) { + borderPaint.style = PaintingStyle.stroke; + _paintLine(canvas, polylineOpt.offsets, borderPaint); + filterPaint.style = PaintingStyle.stroke; _paintLine(canvas, polylineOpt.offsets, filterPaint); } _paintLine(canvas, polylineOpt.offsets, paint);