Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation part 4: Presets #1305

Merged
merged 9 commits into from
Aug 6, 2024
Merged

Animation part 4: Presets #1305

merged 9 commits into from
Aug 6, 2024

Conversation

yshui
Copy link
Owner

@yshui yshui commented Aug 5, 2024

You can now use preset animations, like this:

animations = ({
    triggers = ["close", "hide"];
    preset = "disappear";
    duration = 0.2;
    scale = 0.96;
}, {
    triggers = ["open", "show"];
    preset = "appear";
    duration = 0.2;
    scale = 0.95;
});

Related: #862

Instead of just hardcoded numbers. Now they can be defined with
expressions just like start and end.

Signed-off-by: Yuxuan Shui <[email protected]>
@yshui yshui force-pushed the animation-presets branch 3 times, most recently from 4273e32 to 1f2633b Compare August 5, 2024 18:29
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 82.14990% with 181 lines in your changes missing coverage. Please review.

Project coverage is 54.33%. Comparing base (0efe479) to head (5db4192).

Files Patch % Lines
src/transition/generated/script_templates.c 86.69% 64 Missing ⚠️
tools/animgen.c 76.67% 59 Missing ⚠️
src/transition/script.c 87.80% 20 Missing ⚠️
src/transition/curve.c 58.69% 19 Missing ⚠️
src/config_libconfig.c 68.75% 15 Missing ⚠️
src/transition/preset.c 60.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1305      +/-   ##
==========================================
+ Coverage   52.85%   54.33%   +1.48%     
==========================================
  Files          64       70       +6     
  Lines       14019    14868     +849     
==========================================
+ Hits         7410     8079     +669     
- Misses       6609     6789     +180     
Files Coverage Δ
src/transition/curve.h 100.00% <100.00%> (ø)
src/transition/script.h 100.00% <100.00%> (ø)
src/utils/dynarr.h 100.00% <ø> (ø)
src/utils/str.h 44.44% <ø> (ø)
src/wm/win.c 78.15% <100.00%> (+0.02%) ⬆️
src/wm/win.h 92.85% <ø> (ø)
src/transition/preset.c 60.00% <60.00%> (ø)
src/config_libconfig.c 57.77% <68.75%> (+0.45%) ⬆️
src/transition/curve.c 65.41% <58.69%> (-16.41%) ⬇️
src/transition/script.c 87.50% <87.80%> (-1.50%) ⬇️
... and 2 more

... and 5 files with indirect coverage changes

@yshui yshui force-pushed the animation-presets branch 3 times, most recently from ef23930 to 8555a0f Compare August 6, 2024 00:13
Add a tool to generate C function from a compiled animation script.
The generated function will reproduce the animation script when called.

The goal is to implement animation presets. Instead of creating strings
and then compile them into scripts, by using these generated function,
we can skip the parsing step and create compiled scripts directly.

Placeholders are supported in the preset script, so some configurability
still exists even when using presets.

Signed-off-by: Yuxuan Shui <[email protected]>
Signed-off-by: Yuxuan Shui <[email protected]>
Support multiple choice parameters in additional to plain old numbers.

With this we are now able to change the direction of sliding, yippee!

Signed-off-by: Yuxuan Shui <[email protected]>
@yshui yshui force-pushed the animation-presets branch 2 times, most recently from b3cd24c to d502e1b Compare August 6, 2024 00:21
Signed-off-by: Yuxuan Shui <[email protected]>
@yshui yshui merged commit 1cfd2a0 into next Aug 6, 2024
22 checks passed
@yshui yshui deleted the animation-presets branch August 6, 2024 04:45
@absolutelynothelix absolutelynothelix mentioned this pull request Oct 22, 2024
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