Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyline filled with borderColor #856

Closed
Ahmed-gubara opened this issue Mar 28, 2021 · 8 comments
Closed

Polyline filled with borderColor #856

Ahmed-gubara opened this issue Mar 28, 2021 · 8 comments
Labels
bug This issue reports broken functionality or another error

Comments

@Ahmed-gubara
Copy link
Contributor

Starting with version 0.11.0 with PR #766
Using Polyline to draw path creates shapes (with borderColor), unless you pass Colors.transparent as borderColor.

flutter_map

Going through the source code i found this part

Paint filterPaint;
if (polylineOpt.borderColor != null) {
filterPaint = Paint()
..color = polylineOpt.borderColor.withAlpha(255)
..strokeWidth = polylineOpt.strokeWidth
..strokeCap = StrokeCap.round
..strokeJoin = StrokeJoin.round
..blendMode = BlendMode.dstOut;
}

and

if (borderPaint != null) {
if (filterPaint != null) {
filterPaint.style = PaintingStyle.stroke;
_paintLine(canvas, polylineOpt.offsets, borderPaint);
}
borderPaint?.style = PaintingStyle.stroke;
_paintLine(canvas, polylineOpt.offsets, filterPaint);
}

Swapping filterPaint with borderPaint in the function call _paintLine(...) makes Polyline works normally

Should i make PR for that, or is this intentional?

@kengu
Copy link
Contributor

kengu commented Mar 29, 2021

@escamoteur - I guess the intention was not to change default behaviour of polyline filling?

@kengu kengu added the bug This issue reports broken functionality or another error label Mar 29, 2021
@escamoteur
Copy link
Contributor

nope, that wasn't intended

@escamoteur
Copy link
Contributor

yeah, PR would be nice

@kengu
Copy link
Contributor

kengu commented Mar 31, 2021

@Ahmed-gubara A PR is much appreciated. Add me as reviewer and I will look at it asap.

@escamoteur
Copy link
Contributor

could you check if this is still the case in my null safety branch?

@Ahmed-gubara
Copy link
Contributor Author

@escamoteur It's still present in your null safety branch.
I've made a PR with just placing the line borderPaint.style = PaintingStyle.stroke; before the paint statement.

@escamoteur
Copy link
Contributor

could you make a PR on https://github.com/escamoteur/flutter_map/tree/nullsafety?

@Ahmed-gubara
Copy link
Contributor Author

Ahmed-gubara commented Apr 6, 2021

@escamoteur I've made the PR escamoteur#3, but getting All checks have failed with issues related to files I've not changed.

@kengu kengu closed this as completed in 873b5fc Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error
Projects
None yet
Development

No branches or pull requests

3 participants