Skip to content

Respect clipDepth when reusing timeline instances#50

Open
asimetra wants to merge 1 commit into
openfl:masterfrom
asimetra:fix-clipdepth-dedupe
Open

Respect clipDepth when reusing timeline instances#50
asimetra wants to merge 1 commit into
openfl:masterfrom
asimetra:fix-clipdepth-dedupe

Conversation

@asimetra
Copy link
Copy Markdown

This fixes a timeline instance reuse issue when the same character is placed at the same depth with a different clipDepth.

Previously, Animate and SWFLite timelines deduped instances by character id and depth only. However, clipDepth is stored on the timeline instance when it is created. If a later placement reused the same instance with a different clipDepth, the old mask range could be kept and masking would be applied incorrectly.

The fix includes clipDepth in the duplicate-instance match for both Animate and SWFLite timeline paths.

I attached a small repro project with a minimal SWF asset. The SWF places character 100 at depth 7 without clipDepth, then later places the same character at the same depth with clipDepth = 11.

ClipDepthReuseRepro.zip

Timeline instance deduplication treated matching symbol and depth as enough identity, but clip depth is serialized onto the instance only when it is created. When an asset places the same symbol at the same depth with a different clip depth, reusing the previous instance preserves stale mask range data.

Constraint: SWF PlaceObject clip depth changes alter timeline mask semantics even when symbol and depth are unchanged

Rejected: Refresh clipDepth on reused instances | that would blur update semantics with instance identity and could hide other create-time state differences

Confidence: medium

Scope-risk: narrow

Directive: Keep AnimateLibrary and SWFLite dedupe predicates aligned for serialized timeline instance identity

Tested: haxe rebuild.hxml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant