-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fixed issue where having the settings tab open would reset the editor camera entity on loop #228
Conversation
…editor camera entity
Will take a look tomorrow, thank you for the PR |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #228 +/- ##
==========================================
- Coverage 23.52% 23.50% -0.03%
==========================================
Files 55 55
Lines 7648 7655 +7
==========================================
Hits 1799 1799
- Misses 5849 5856 +7 ☔ View full report in Codecov by Sentry. |
Can you please run cargo fmt and cargo clippy to fix the ci errors. |
Alright, done. By the way, what does cargo clippy do ? I knew of fmt, but the doc I found on clippy is not very clear on what the command actually do. Is it something to do with code merging ? |
Clippy is a linter, so it suggests code improvements in performance, correctness and style. You have different levels of the linter. We use all and nursery (this one has some in development linter, but most of them are really good) |
Thank for your contribution, great call |
The settings tab wants to despawn and respawn the editor camera entity when the game mode was modified from 2D to 3D and vice-versa; however, due to the fact that the function
GameModeSettings.ui
had a&mut self
reference, and thus require to call a mutable reference to the resource everytime is drawn, bevy automatically declared the resource as modified every frame, resulting in the camera being killed and revived at every pre-update.With the fix, the ui function only require a
&self
and returns a value if there is a change, so that a mutable version of the GameModeSettings resource is only asked when the game mode is indeed modified.