Skip to content

Commit

Permalink
Merge pull request #3 from Ahmed-gubara/patch-1
Browse files Browse the repository at this point in the history
Fix polyline border drawing
  • Loading branch information
escamoteur committed Apr 7, 2021
2 parents 3a4ff10 + 7736df4 commit a4957be
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/src/layer/polyline_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,22 @@ 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(
canvas, polylineOpt.offsets, radius, spacing, filterPaint!);
canvas, polylineOpt.offsets, radius, spacing, filterPaint);
}
_paintDottedLine(canvas, polylineOpt.offsets, radius, spacing, paint);
canvas.restore();
} else {
paint.style = PaintingStyle.stroke;
canvas.saveLayer(rect, Paint());
if (borderPaint != null) {
if (filterPaint != null) {
filterPaint.style = PaintingStyle.stroke;
_paintLine(canvas, polylineOpt.offsets, borderPaint);
}
if (borderPaint != null && filterPaint != null) {
borderPaint.style = PaintingStyle.stroke;
_paintLine(canvas, polylineOpt.offsets, filterPaint!);
_paintLine(canvas, polylineOpt.offsets, borderPaint);
filterPaint.style = PaintingStyle.stroke;
_paintLine(canvas, polylineOpt.offsets, filterPaint);
}
_paintLine(canvas, polylineOpt.offsets, paint);
canvas.restore();
Expand Down

0 comments on commit a4957be

Please sign in to comment.