Fix zIndex ordering for alpha zero elements - #614
Open
eXecutable wants to merge 1 commit into
Open
Conversation
forceZIndexContext=true on PlaybackHudLiveSle creates a z-context BingeRailOverlay is added → enableZSort → _zSort=true During update(), updateTreeOrder() skips alpha=0 children (textLayer, AdsOverlayWithBrightlineSle) — their _updateTreeOrder stays stale During render(), sortZIndexedChildren() sorts using mix of fresh and stale values → wrong order → _zSort=false Later, textLayer becomes visible → gets updated _updateTreeOrder → but _zSort remains false → _zIndexedChildren array is never re-sorted → LiveSlePlayerOverlay paints on top of textLaye
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect z-index rendering order when previously invisible (alpha=0) elements become visible inside a z-context, by ensuring the z-indexed child list is re-sorted after visibility transitions.
Changes:
- When an element transitions from invisible to visible, mark it for z-order re-sort (
_zIndexResort) and re-enable z-sorting on its z-parent. - Preserve the existing “force update on becoming visible” behavior while ensuring z-order is recalculated.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wouterlucas
approved these changes
Aug 16, 2026
wouterlucas
left a comment
Contributor
There was a problem hiding this comment.
LGTM @jfboeve - can we run this next week?
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.
forceZIndexContext=true on Element creates a z-context
new Element is added → enableZSort → _zSort=true
During update(), updateTreeOrder() skips alpha=0 children — their _updateTreeOrder stays stale
During render(), sortZIndexedChildren() sorts using mix of fresh and stale values → wrong order → _zSort=false
Later, textLayer becomes visible → gets updated _updateTreeOrder → but _zSort remains false → _zIndexedChildren array is never re-sorted → paints are in the wrong order