Remove the Mutex from Animated#129
Merged
Merged
Conversation
a8f114e to
d5b1e28
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the internal Mutex from animation::Animated, shifting the API to require mutable access for progressing animations and returning references instead of owned values. It updates downstream call sites (desktop + examples) to dereference returned references or use latest_value() where mutation/progression isn’t desired/possible.
Changes:
- Refactor
Animated<T>to storeAnimatedInner<T>directly (no mutex), makevalue()require&mut selfand return&T, and addlatest_value()for non-progressing reads. - Update desktop presenters/systems and the logs example to accommodate reference-returning getters (
*value,*final_value,latest_value()). - Adjust camera access to align with the new
AnimatedAPI (DesktopSystem::camera(&mut self) -> &PixelCamera).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
animation/src/animated.rs |
Removes mutex-based interior mutability; changes read APIs to return references and requires &mut to progress animations. |
desktop/src/desktop.rs |
Updates camera retrieval to dereference the new &PixelCamera return. |
desktop/src/desktop_system.rs |
Changes camera() accessor signature to return a reference and require &mut self. |
desktop/src/desktop_system/layout_effects.rs |
Updates camera locking and hover placement composition to use dereferenced refs / latest_value(). |
desktop/src/desktop_system/presentation.rs |
Updates originating instance transform read to use latest_value(). |
desktop/src/instance_presenter.rs |
Updates animation application to dereference Animated::value() results. |
desktop/src/projects/launcher_presenter.rs |
Updates alpha usage and final_value() comparisons for ref-returning APIs. |
desktop/src/projects/project_presenter.rs |
Updates hover alpha usage for ref-returning APIs. |
examples/logs/examples/logs.rs |
Updates animated value reads to dereference refs and uses latest_value() for logging. |
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.
This is the first step for making the animation system simpler, but it currently has an essential problem which come from the fact that the visor layout depends on the expansion factor, which is an animated value.