mapbox / mapbox/mapbox-gl-js

Unexpected background of sdf icon when icon-halo-width more than some critical value.

Open
#7,204 1 comment 0 reactions 1 assignee View on GitHub

@ChrisLoer is already working on this.

Since Oct 18, 2018.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

mapbox-gl-js version: 0.48.0

browser: chrome

Steps to Trigger Behavior
  1. Add sdf icon
  2. Set icon-halo-width to some big value
Link to Demonstration

http://jsbin.com/heqadegucu/edit?html,output

Expected Behavior

We should not see an unexpected background of image. (In this example icon-halo-width has a value less than critical)
image

Actual Behavior

We can see an unexpected background of image.
image

Additional information

For some combination of values, everything is fine (e.g. icon-halo-width=2, icon-halo-blur=2, these are the same values as used in [icon-halo-blur/literal| https://github.com/mapbox/mapbox-gl-js/blob/8121e9db044533d7e44e0afc8c58e71b6d8ec260/test/integration/render-tests/icon-halo-blur/literal/style.json] test, also OK for 3/1, 3/2, 4/1 combinations of icon-halo-width, icon-halo-blur).
But for some combination of values of icon-halo-width/icon-halo-blur (e.g. 3/3, 4/2, 4/3, 4/4, 5/1, 6/0) there’s a semi-transparent fill for whole icon background. It seem to have different transparency depending on particular values, for some values the fill is almost invisible, for others it is hard to miss it even with the naked eye.
This seems like a bug, which makes icon halo unusable for some cases.
It could be reproduced using SDF icon (e.g. https://github.com/mapbox/mapbox-gl-js/blob/8121e9db044533d7e44e0afc8c58e71b6d8ec260/test/integration/image/line.sdf.png) or sprites (like in https://github.com/mapbox/mapbox-gl-js/blob/8121e9db044533d7e44e0afc8c58e71b6d8ec260/test/integration/render-tests/icon-halo-blur/literal/style.json test). The same effect happens in different browsers (Chrome, Firefox, Internet Explorer)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.