-
Notifications
You must be signed in to change notification settings - Fork 78
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
Upgrade to Bevy 0.14 & upgrade egui-gizmo dependency #110
Conversation
but a bit buggy
accidentally committed changes
and added documentation here and there
to avoid panics
Addresses Bevy [9202](bevyengine/bevy#9202)
Addresses Bevy [13317](bevyengine/bevy#13317)
Addresses Bevy[9202](bevyengine/bevy#9202)
Addresses Bevy [12163](bevyengine/bevy#12163)
Addresses Bevy [12715](bevyengine/bevy#12715)
Addresses Bevy [12163](bevyengine/bevy#12163)
Addresses egui #4556 (emilk/egui#4556)
Addresses egui #4728 (emilk/egui#4728)
Addresses egui #4614 (emilk/egui#4614)
@jakobhellermann The changes for bevy 0.14 are done here -- this is just waiting on a few dependencies to get published to crates.io (& PR #106). FYI commit e9bec52 also bumps the version number to 0.9.0 & adds corresponding entries to README, CHANGELOG -- but let me know if you want me to revert that. |
Thanks a lot. I'll update |
|
Addresses Bevy #12859 (bevyengine/bevy#12859)
Hmm just noticed a few more things: forgot about the examples 😅 but more seriously, opening any editor window results in:
which is caused by bevy_editor_pls/crates/bevy_editor_pls_core/src/editor.rs:460: ui.allocate_space(ui.available_size() - (5.0, 5.0).into()); It sometimes requests space with negative width, which was "tolerated" before egui 0.28, but since egui #4478 is now an assert that panics. I'm not so familiar with how this crate handles sizes, so I'm not sure how to deal with this yet. Any ideas? |
Addresses Bevy #12163 (bevyengine/bevy#12163)
I'd try replacing the -5 with something like a saturating_sub or an if to make sure it never goes below zero. |
Addresses Bevy #12426 (bevyengine/bevy#12426)
Hmm, changing it to let desired_size = (ui.available_size() - (5.0, 5.0).into()).max((0.0, 0.0).into());
ui.allocate_space(desired_size); where desired_size.y used to be -5 and is now 0, leads to an ever growing window height (here on the "empty" example): expanding-window.mp4For context, here is the surrounding for loop: for (i, floating_window) in floating_windows.into_iter().enumerate() {
let id = egui::Id::new(floating_window.id);
let title = self.windows[&floating_window.window].name;
let mut open = true;
let default_size = self.windows[&floating_window.window].default_size;
let mut window = egui::Window::new(title)
.id(id)
.open(&mut open)
.resizable(true)
.default_size(default_size);
if let Some(initial_position) = floating_window.initial_position {
window = window.default_pos(initial_position - egui::Vec2::new(10.0, 10.0))
}
window.show(ctx, |ui| {
self.editor_window_inner(world, internal_state, floating_window.window, ui);
let desired_size = (ui.available_size() - (5.0, 5.0).into()).max((0.0, 0.0).into());
ui.allocate_space(desired_size);
});
if !open {
close_floating_windows.push(i);
}
} |
The examples are now migrated, Some examples are a bit broken, although this was already the case on
|
Hmm, I'm not sure I have time to debug the growing-window-height issue above. Does anyone else with more experience with egui have an idea how to resolve this? |
I can't seem to repro the issue, you said using the Open Window would cause it right? |
@Aceeri Could you give these steps a try: git clone [email protected]:zhaop/bevy_editor_pls.git --branch bevy-0.14
cd bevy_editor_pls/crates/bevy_editor_pls
cargo run --example empty Then, click "Open window", then click "Hierarchy". What I see: the Hierarchy window shows up, and its height continuously grows until filling the whole window height. What I expected to see: the Hierarchy window shows up at a certain size and stays the same size. |
Gotcha, I can see it now |
@zhaop What is the status of this PR? Is help needed? |
@XX I'd be happy if someone could take over this PR -- I don't think I'll have time to work on this anymore (and have moved away from using this crate in my project). As I understand, it basically works, except for that one problem where the height of certain windows keeps growing when it shouldn't. |
I think I figured out a fix for that, the windows where this was a problem had |
I think this is good to merge now, thank you very much for the PR @zhaop and everyone for the patience, I'm gonna merge this now and release a new version |
Thanks a lot @jakobhellermann for the fix :) |
I am no longer working on this PR due to lack of time. I'm keeping it open for now for visibility -- feel free to make your own changes and make it your own PR.
It basically works, except for one problem where certain windows would keep growing in height.
This PR allows bevy_editor_pls to be used with Bevy 0.14, and is based on top of #106 by @ActuallyHappening .
Before anything happens to this, we should probably first:
transform_gizmo_bevy
to updateegui
version #106 merged & rebase this PR on topConcretely, this implements the following migration steps:
App
andSubApp
internals for better separation bevyengine/bevy#9202 : Use app.world_mut() or .world() instead of .worldApp
andSubApp
internals for better separation bevyengine/bevy#9202 : Match app.get_sub_app as Option instead of ResultLegacyColor
tobevy_color::Color
bevyengine/bevy#12163 : Use Color::srgb* instead of Color::rgb*egui::Style
emilk/egui#4556 : Replace Label::wrap(false) -> Label::extend()clamp_to_range
option to DragValue, renameclamp_range
torange
(deprecating the former) emilk/egui#4728 : Rename DragValue::clamp_range -> DragValue::rangeui.set_enabled
andset_visbile
emilk/egui#4614 : Use ui.add_enabled_ui instead of ui.set_enabledLegacyColor
tobevy_color::Color
bevyengine/bevy#12163 : Change Color::rgb -> Color::srgbextra_asserts
andextra_debug_asserts
feature flags emilk/egui#4478 : Fix panic when requesting negatively sized space from eguiand also fixes an example: