Skip to content
Snippets Groups Projects
Commit 5b47e958 authored by John Mitchell's avatar John Mitchell
Browse files

Format code.

parent a6492787
No related branches found
No related tags found
No related merge requests found
......@@ -865,7 +865,7 @@ fn update_widget(
) -> (Tree, bool) {
// Check if we should update this widget
let should_rerender = {
// TODO: Move the spawning to when we create the widget.
// TODO: Move the spawning to when we create the widget.
let old_props_entity =
if let Ok(mut cloned_widget_entities) = cloned_widget_entities.try_write() {
let old_parent_entity = if let Ok(tree) = tree.try_read() {
......@@ -874,7 +874,9 @@ fn update_widget(
} else {
None
}
} else { None };
} else {
None
};
if let Some(entity) = cloned_widget_entities.get(&entity.0).copied() {
if let Some(possible_entity) = world.get_entity(entity) {
let target = possible_entity.id();
......
use bevy::prelude::{Bundle, Commands, Component, Entity, In, Query, Vec2, BuildChildren};
use bevy::prelude::{BuildChildren, Bundle, Commands, Component, Entity, In, Query, Vec2};
use crate::{
children::KChildren,
......@@ -173,7 +173,10 @@ pub fn scroll_context_render(
)>,
) -> bool {
if let Ok((context_provider, children, styles, mut computed_styles)) = query.get_mut(entity) {
let context_entity = commands.spawn(context_provider.initial_value).set_parent(entity).id();
let context_entity = commands
.spawn(context_provider.initial_value)
.set_parent(entity)
.id();
widget_context.set_context_entity::<ScrollContext>(Some(entity), context_entity);
*computed_styles = styles.clone().into();
children.process(&widget_context, Some(entity));
......
......@@ -76,7 +76,10 @@ pub fn window_context_render(
{
context_entity
} else {
commands.spawn(WindowContext::default()).set_parent(window_context_entity).id()
commands
.spawn(WindowContext::default())
.set_parent(window_context_entity)
.id()
};
widget_context
.set_context_entity::<WindowContext>(Some(window_context_entity), context_entity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment