From 180c62cb706c95690961523d8b3a6d508b26918f Mon Sep 17 00:00:00 2001 From: Asimetra Date: Thu, 30 Apr 2026 16:11:20 +0300 Subject: [PATCH] Keep clip-depth changes from reusing timeline instances 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 --- src/swf/exporters/animate/AnimateTimeline.hx | 3 ++- src/swf/exporters/swflite/timeline/SymbolTimeline.hx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/swf/exporters/animate/AnimateTimeline.hx b/src/swf/exporters/animate/AnimateTimeline.hx index dbe2cca..15cded6 100644 --- a/src/swf/exporters/animate/AnimateTimeline.hx +++ b/src/swf/exporters/animate/AnimateTimeline.hx @@ -372,7 +372,8 @@ class AnimateTimeline extends Timeline { if (activeInstance.displayObject != null && activeInstance.characterID == frameObject.symbol - && activeInstance.depth == frameObject.depth) + && activeInstance.depth == frameObject.depth + && activeInstance.clipDepth == frameObject.clipDepth) { // TODO: Fix duplicates in exporter instance = activeInstance; diff --git a/src/swf/exporters/swflite/timeline/SymbolTimeline.hx b/src/swf/exporters/swflite/timeline/SymbolTimeline.hx index ed1e8d2..2ba01ab 100644 --- a/src/swf/exporters/swflite/timeline/SymbolTimeline.hx +++ b/src/swf/exporters/swflite/timeline/SymbolTimeline.hx @@ -210,7 +210,8 @@ class SymbolTimeline extends Timeline { if (activeInstance.displayObject != null && activeInstance.characterID == frameObject.symbol - && activeInstance.depth == frameObject.depth) + && activeInstance.depth == frameObject.depth + && activeInstance.clipDepth == frameObject.clipDepth) { // TODO: Fix duplicates in exporter instance = activeInstance;