From 68f8b892ce9de032e1a6f3079c2f91a56eb72a47 Mon Sep 17 00:00:00 2001 From: ILOVEPIE Date: Tue, 26 Dec 2023 13:11:59 -0800 Subject: [PATCH] Fixes for clip anim and anim related performance. --- src/renderer-main.js | 11 ++++++----- src/subtitle-event.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/renderer-main.js b/src/renderer-main.js index 3f66c39..ba524bf 100644 --- a/src/renderer-main.js +++ b/src/renderer-main.js @@ -546,7 +546,8 @@ const renderer_prototype = global.Object.create(Object, { if ( events[i].getLineOverrides().hasMovement() || events[i].getLineOverrides().getFade() !== null || - events[i].getLineTransitionTargetOverrides() !== null || + (events[i].getLineTransitionTargetOverrides() !== null && + events[i].getLineTransitionTargetOverrides().length > 0) || events[i].getOverrides().getKaraokeMode() !== sabre.KaraokeModes.OFF || events[i].getOverrides().getTransitions().length > 0 @@ -3070,7 +3071,7 @@ const renderer_prototype = global.Object.create(Object, { ].getTransitionAcceleration(); clip[0] = sabre.performTransition( time, - /** @type {number} */ (clip[0]), + /** @type {!number} */ (clip[0]), transitionClip[0], transitionStart, transitionEnd, @@ -3078,7 +3079,7 @@ const renderer_prototype = global.Object.create(Object, { ); clip[1] = sabre.performTransition( time, - /** @type {number} */ (clip[1]), + /** @type {!number} */ (clip[1]), transitionClip[1], transitionStart, transitionEnd, @@ -3086,7 +3087,7 @@ const renderer_prototype = global.Object.create(Object, { ); clip[2] = sabre.performTransition( time, - /** @type {number} */ (clip[2]), + /** @type {!number} */ (clip[2]), transitionClip[2], transitionStart, transitionEnd, @@ -3094,7 +3095,7 @@ const renderer_prototype = global.Object.create(Object, { ); clip[3] = sabre.performTransition( time, - /** @type {number} */ (clip[3]), + /** @type {!number} */ (clip[3]), transitionClip[3], transitionStart, transitionEnd, diff --git a/src/subtitle-event.js b/src/subtitle-event.js index a7f005e..afa1ba7 100644 --- a/src/subtitle-event.js +++ b/src/subtitle-event.js @@ -218,7 +218,7 @@ sabre["SSASubtitleEvent"] = function SSASubtitleEvent () { "getLineTransitionTargetOverrides": { value: function getLineTransitionTargetOverrides () { - return obj.lineTransitionTargetOverrides.slice(0); + return obj.lineTransitionTargetOverrides; }, writable: false }