-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix double drawing on fill outlines #2757
Comments
Version 19+ and version 18 handle transparency really differently: Started in version 19.0 – http://codepen.io/samanbb/pen/aZmRdx The older behavior is the expected behavior. Almost all styles except those designed in the last few weeks will assume transparency renders like in the bottom example. |
There was some discussion about how to "correctly" handle opacity in the style spec a while ago: mapbox/mapbox-gl-style-spec#273 I proposed:
Seems like the recent change was accidental. Ideally we have both per-feature and per-layer opacity, and the way this works is clearly defined in the style spec. Short term, I would love to see the recent change to opacity-* rules reverted so styles designed before v19 look the way the designer wanted them to look. |
Thanks for the clarification @samanpwbb. I misunderstood the bug before. This change in behaviour is due to us merging earcut #1606.
As of GL JS v0.19.0 every style property is defined per-feature. Pre-earcut fill style properties were the only exception to this rule. As far as I know, all style properties in GL Native have always been per-feature. (Can you confirm, @jfirebaugh?). It is possible that GL Native has always been rendering translucent polygons like this and only now is GL JS rendering them consistently. I will open a ticket about supporting per-feature and per-layer style properties in mapbox-gl-style-spec.
We can revert the behaviour if
Next Steps
|
one issue: if fill is semitransparent, it is now impossible to use antialiasing without a noticeable stroke. Do you see any way around that? There will continue toge many cases where per-layer rather than per-feature styling is desirable, will wait for that discussion in the style spec repo though. |
Original issue discussing rendering behavior for overlapping semi-transparent fills is #859. As noted there, the behavior prior to earcut was considered a bug. @samanpwbb, can you provide a minimized test case for the issue with antialiasing? |
All of the "Next Steps" outlined in this ticket have been 🚢ed! |
If you draw a semi-transparent fill layer, the outline is drawn twice, resulting in a outline that is twice the desired opacity and a mix of the fill color and the outline color.
See the demo at http://jsbin.com/peraxujibo/6/edit?html,output
I'm not yet sure if this behaviour is new or intentional.
cc @samanpwbb
The text was updated successfully, but these errors were encountered: