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

[BUG] Polyline with border ignores color in V4 #1510

Closed
Wackymax opened this issue May 10, 2023 · 6 comments · Fixed by #1519
Closed

[BUG] Polyline with border ignores color in V4 #1510

Wackymax opened this issue May 10, 2023 · 6 comments · Fixed by #1519
Labels
bug This issue reports broken functionality or another error

Comments

@Wackymax
Copy link

What is the bug?

When setting a border color on a polyline the color property gets ignored and the polyline is drawn with a black color.

How can we reproduce it?

Set the color property and the border color property on a polyline.

Do you have a potential solution?

I may be wrong but it looks like the wrong color value is set in filterPaint in the polyline_layer class.

Platforms

All flutter platforms

Severity

Minimum: Allows normal functioning

@Wackymax Wackymax added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels May 10, 2023
@JaffaKetchup JaffaKetchup added non-fatal and removed needs triage This new bug report needs reproducing and prioritizing labels May 10, 2023
@JaffaKetchup
Copy link
Member

Thanks for reporting. It's reproducible. Will investigate a fix.

@JaffaKetchup
Copy link
Member

This issue looks similar to #1420.
It arrived at some point prior to 3eda247, and as such is a very old issue.

@Wackymax
Copy link
Author

This issue looks similar to #1420. It arrived at some point prior to 3eda247, and as such is a very old issue.

I am not to sure. The color worked correctly before I upgraded to V4.

@JaffaKetchup
Copy link
Member

Hmm, maybe I messed up back tracing through commits then.

@ibrierley
Copy link
Contributor

I haven't got a lot of time to dig into it just atm, but I suspect it may be related to batching code, eg around c4b6680 and if I revert to a previous commit to that it all works.

Maybe it's trying to batch forgetting about the separate layers when having a border or something.

@ibrierley
Copy link
Contributor

I think the main problem is possibly the ordering of the paints is wrong. We want to draw the main path/paint after the borders, so I think that may be an easy fix if it comes to it..There's something a little different with the filterPaint/path I'm confused about, but I'm not entirely sure how that works...

Maybe we need to clarify the logic and reasons...we have

  1. the main paint/path, fine
  2. if the borderStrokeWidth > 0 we set the borderPaint color...makes sense.
  3. if the borderColor is not null, we set the filter paint and use Blendmode.dstOut
    ( dstOut is == Show the destination image, but only where the two images do not overlap. The source image is not rendered, it is treated merely as a mask. The color channels of the source are ignored, only the opacity has an effect.)

Whats 3 for, is it for opacity on lines that have a border color or something ?

If someone needs a super quick fix, you could try swapping the order of the paints in polylinelayer.dart, but it would be nice before we do a change to know that its either a) the same as previous, or b) its different because of a fix (so need to double check lines with opacity and things like that).

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
3 participants