Commit graph

34 commits

Author SHA1 Message Date
Simon Hausmann
6ca63aac9c Make it possible to delegate the timer handling to the backend
When building with no_std, the backend can provide the global
instant.
2021-11-30 17:27:55 +01:00
Olivier Goffart
e8271b8f1d Make corelib work without thread_local in no_std 2021-11-29 21:00:35 +01:00
Olivier Goffart
844c5cf7ec Gate the Path item behind the 'std' feature 2021-11-25 16:53:07 +01:00
Olivier Goffart
80c0602277 WIP: start making the corelib crate a no_std crate
Does not compile yet with no_std because of the lack of
alternative for thread_local
2021-11-25 12:02:16 +01:00
Tobias Hunger
f762f6dab2 Sub_Assign should probably subtract, not add 2021-07-02 23:18:14 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
c9c0f8d638 Fix useless dependency on the animation tick
This was causing the Qt backend to redraw parmanently
2021-04-26 15:24:48 +02:00
Simon Hausmann
2ce672bd68 Reduce dependencies
Use only specific lyon packages instead of pulling all of them in.
This slightly speeds up compilation as well as for example lyon_tesselation
doesn't need to be compiled anymore.
2021-02-09 17:22:01 +01:00
Simon Hausmann
73a1313072 Add some missing internal documentation 2021-01-14 08:53:13 +01:00
Olivier Goffart
9ef1c36a52 Move the eventloop module to the backend 2021-01-14 08:53:13 +01:00
Olivier Goffart
9050c29305 Don't use the window through the eventloop module 2021-01-14 08:53:13 +01:00
Olivier Goffart
e75f617125 Fix event loop being blocked because it wouldn't notice that animation is still running
The active_animation was set to false, but if the animation tick did not change, the animation tick
was not maked dirty, and we wouldn't then re-evaluate animated property that would set the
active_animation to true again
2020-12-09 17:28:14 +01:00
Olivier Goffart
cfa9413861 More work on the state binding for transition:
When there is a transition, turn the state property into a property of StateInfo

Not yet implemented for C++
2020-11-19 12:43:28 +01:00
Olivier Goffart
103c7cf9a5 Use a custom Instant that is repr(C) 2020-11-18 16:37:22 +01:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
5e6bc55fe6 Reduce precision for the cubic easing curve
As suggested by Olivier. Also added another test.
2020-08-05 15:41:30 +02:00
Simon Hausmann
00b05bf891 Fix easing curves once more
Olivier is right, mixing t and x like that is not correct. Revert to the
previous formula with increased precision.
2020-08-05 15:32:58 +02:00
Simon Hausmann
99c71cca05 Avoid jumps when using cubic easing curves
solve_t_for_x uses newton's method or binary search with the provided
tolerance to find t. The default tolerance is 0.1 and our control points
are between 0.1, so the resulting t is not very fine grained.

Instead, first go from t to x and then x becomes the new t for y.

The included but commented out test can be used to verify that the
curves are correct.
2020-08-05 14:51:07 +02:00
Olivier Goffart
d43fcfe3ea Remove stray dbg! 2020-08-05 13:28:20 +02:00
Olivier Goffart
1741b90b4e Implement a SIXTYFPS_SLOW_ANIMATIONS env variable
that can be set to a factor to reduce the speed of animations
2020-08-05 13:21:29 +02:00
Simon Hausmann
97a2fb2c7b Move datastructures::EasingCurve into animations 2020-08-03 13:49:20 +02:00
Olivier Goffart
9760cf4969 Begin to implement a Flickable
The implementation is still very rough and will need to be improved
2020-07-30 14:36:21 +02:00
Olivier Goffart
46a011683f Implement easing curve in the runtime 2020-07-29 15:20:28 +02:00
Olivier Goffart
e00491811b Get rid of the context in properties/signal 2020-07-13 18:49:06 +02:00
Olivier Goffart
90ed79e39f Remove unused code in the animation driver 2020-07-02 17:36:34 +02:00
Olivier Goffart
9d852f802e Property refactoring
The tests are working and everything seems to be back normal.
But there is still some cleanup required
2020-07-02 14:14:49 +02:00
Simon Hausmann
fb74a8ddd4 Fix animations for the wasm build
Use the instant crate that has a transparent fall-back to performance.now().
2020-06-25 09:07:04 +02:00
Simon Hausmann
8675cfb183 Fix animation driver to deal with freed animations
Just skip over those entries.
2020-06-25 08:58:13 +02:00
Simon Hausmann
688f111563 Added simple linear property animation class 2020-06-23 13:27:09 +02:00
Simon Hausmann
d99972a77a Simplify animation driver handling
Instead of passing it through the event loop, make it accessible as a
thread local variable.
2020-06-23 13:03:35 +02:00
Simon Hausmann
7694337181 Simplify the animation driver API
By making the duration a "property" of the Animated trait, we can reduce
the API surface.
2020-06-22 19:27:15 +02:00
Simon Hausmann
0aa4d85c92 Start with data structures for animations, with a duration and basic controls 2020-06-15 18:02:23 +02:00