Merged
Conversation
animate(frames, 500) previously aborted the interpreter with std::bad_variant_access because AnimateFunction assumed a MacInstance and called std::get without checking. The documented invocation animate(frames, Duration(500)) worked; anything else crashed the process without a line number or message. This commit rewrites AnimateFunction::call to: - Accept a raw number as the duration (interpreted as milliseconds) in addition to a Duration instance - Validate the array-of-memes argument instead of blindly std::get'ing it - Throw std::runtime_error (which the interpreter wraps into a line- numbered RuntimeError) on any invalid type, instead of aborting - Reject non-positive durations with a clear message Adds two test files: - tests/memes/animate_types.mac covers the happy path for both the number and Duration forms - tests/memes/animate_bad_type.mac pins the error message for invalid arguments so this specific regression cannot silently come back All 93 tests pass (91 existing + 2 new).
The parser has accepted 'bounce' as a transition easing keyword for multiple versions, and it is listed in docs/reference/src/meme/gif.md (previously) and the mac-language skill as a valid easing option. However, MacTimeline::applyEasing had no 'bounce' case, so every transition with 'bounce' silently rendered as linear. Implements easeOutBounce using Robert Penner's canonical parameters (n1 = 7.5625, d1 = 2.75), which is the same formulation used by GSAP, d3-ease, and the CSS WG bounce reference. At the transition's endpoint, the interpolation overshoots slightly, settles, overshoots a smaller amount, and lands — producing the 'bouncing into place' feel that the keyword advertises. At t = 0.5 the new easing returns ~0.77 vs. linear's 0.5; at t = 0.75 it returns ~0.97 vs. 0.75. The difference is visible as the transition appearing to land early and settle, instead of sliding in at constant speed. tests/timeline/bounce_easing.mac is added as a regression guard so the parser/interpreter asymmetry cannot silently reappear. All 94 tests pass (93 + 1 new).
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.
No description provided.