Repository navigation
fix(core): clear a View to transparent for an explicit zero alpha - #11153
Merged
Merged
Conversation
clearColor[3] || 255 filled an omitted alpha but also turned an explicit 0 into opaque in the default 0-255 mode. Fill only an omitted alpha, matching the normalizedColors branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Medium impact] The PR appears safe to merge. SummaryFixes
Reviews (1) · Last reviewed commit: "fix(core): clear a View to transparent f..." · Reviewed by Greptile |
ibgreen
approved these changes
Nov 17, 2026
ibgreen
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the clear-alpha change and regression coverage. Explicit zero stays transparent, omitted alpha remains opaque, and the picking guard is unchanged. The upgrade guide documents the byte-mode behavior change.
22 of 52 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up of #11149
Introduced by #9650
Background
A View's
clearColorusesclearColor[3] || 255in the default 0–255 mode, so an explicit zero alpha clears opaque. I added|| 255in #9650 to fill an omitted alpha, so a zero alpha turning opaque is a bug. A View can't clear to transparent unless the app opts intonormalizedColors. Noodles.gl hit this with[0, 0, 0, 0](joby-aviation/noodles.gl#892).Change List
LayersPass: fill only an omitted clear alpha, in both color modesViewclearColoralphaVerified with the
layers-passheadless tests, node tests andyarn lint. The zero-alpha assertion fails on master.🤖 Generated with Claude Code
Note
Low Risk
Low risk bug fix correcting alpha fallback evaluation for View viewport clears.
Overview
Fixes an issue in
LayersPasswhere a View'sclearColorwith an explicit zero alpha (such as[0, 0, 0, 0]) cleared to opaque when using default 0–255 byte colors.Alpha resolution now uses nullish coalescing (
??) instead of logical OR (||), ensuring an explicit zero alpha clears to transparent while omitted alpha defaults to opaque. Documentation, v10 upgrade notes, and unit tests have been updated to reflect this behavior.Reviewed by Cursor Bugbot for commit 07c93ce. Bugbot is set up for automated code reviews on this repo. Configure here.