Skip to content

Canvas source not respecting alpha values set on canvas element #7302

Closed
@ryanhamley

Description

mapbox-gl-js version:
post-v0.49.0 (this bug has not hit a release yet but is reproducible on master)

browser:
any

Steps to Trigger Behavior

  1. Draw/render image on a canvas element with some alpha transparency
  2. Add canvas element to a canvas source

Link to Demonstration

https://codepen.io/rsh412/pen/ZMVNJq?editors=1010#0

Note that this is an example of the canvas source working as expected. I can't get a buggy example to work in JSBin or Codepen because the bug isn't in a release. But at least this shows a testable setup.

Expected Behavior

Canvas source should render alpha transparency set by canvas element

Actual Behavior

Canvas source renders alpha channel with opacity of 1

v0.49.0 (correct alpha opacity)
screen shot 2018-09-19 at 5 20 13 pm

master (incorrect alpha opacity)
screen shot 2018-09-19 at 5 20 43 pm

git bisect points to something in #7039 as the culprit. cc @ansis

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions