fix: address code review findings#3
Merged
Merged
Conversation
- B1: Rename keyframe field 'time' to 'progress' for API consistency - B2: Validate animation duration > 0 in Animate() - B3: Pre-resolve CubicBezier easing functions at animation start - B4: Save and restore original frame scale/alpha - B5: Document single-point-anchor requirement - B6: Unroll InterpolateProperties to eliminate per-tick table allocation - P2: Enhanced keyframe validation (ordering, boundaries, duration) - P3: Deferred onFinished callbacks after all completions processed - P4: Clamp scale minimum to 0.001 to prevent SetScale(0) errors BREAKING CHANGE: Keyframe definitions now use 'progress' field instead of 'time'
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.
Summary
Addresses all findings from comprehensive code review.
Bug Fixes
timetoprogress— aligns code with README documentation. Consumers following the README would have created broken animations.duration > 0inAnimate()— negative duration caused infinite broken animations.frame:GetScale()/frame:GetAlpha()—Stop()now correctly restores pre-animation values instead of hardcoded 1.0.InterpolateProperties— removes temp table +ipairsiterator allocation per OnUpdate tick.Robustness
RegisterAnimationvalidation — checks keyframe ordering, 0.0/1.0 boundaries,defaultDuration > 0.onFinishedcallbacks — all completion state is cleaned up before any callbacks fire, preventing one erroring callback from blocking others.SetScale(0)errors from custom animations.Breaking Change
Keyframe definitions now use
progressfield instead oftime. This aligns with the README documentation. Since v1.0.0 has no external consumers yet, this is safe to ship.Library minor version bumped: 1 → 2