Skip to content

Commit

Permalink
fix flex system ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Feb 7, 2021
1 parent b532235 commit e23c8a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion crates/bevy_text/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use bevy_render::{
renderer::{BindGroup, RenderResourceBindings, RenderResourceId},
};
use bevy_sprite::TextureAtlasSprite;
use bevy_utils::tracing::error;

use crate::{PositionedGlyph, TextSection};
use bevy_render::pipeline::IndexFormat;
Expand Down Expand Up @@ -44,7 +45,7 @@ impl<'a> Drawable for DrawableText<'a> {
{
draw.set_vertex_buffer(0, vertex_attribute_buffer_id, 0);
} else {
println!("Could not find vertex buffer for `bevy_sprite::QUAD_HANDLE`.")
error!("Could not find vertex buffer for `bevy_sprite::QUAD_HANDLE`.")
}

let mut indices = 0..0;
Expand Down
15 changes: 11 additions & 4 deletions crates/bevy_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub mod prelude {
}

use bevy_app::prelude::*;
use bevy_ecs::{IntoSystem, SystemStage};
use bevy_ecs::{IntoSystem, ParallelSystemDescriptorCoercion, SystemStage};
use bevy_render::render_graph::RenderGraph;
use update::ui_z_system;

Expand All @@ -31,6 +31,10 @@ pub mod stage {
pub const UI: &str = "ui";
}

pub mod system {
pub const FLEX: &str = "flex";
}

impl Plugin for UiPlugin {
fn build(&self, app: &mut AppBuilder) {
app.init_resource::<FlexSurface>()
Expand All @@ -41,10 +45,13 @@ impl Plugin for UiPlugin {
)
.add_system_to_stage(bevy_app::stage::PRE_UPDATE, ui_focus_system.system())
// add these stages to front because these must run before transform update systems
.add_system_to_stage(stage::UI, widget::text_system.system())
.add_system_to_stage(stage::UI, widget::image_node_system.system())
.add_system_to_stage(stage::UI, widget::text_system.system().before(system::FLEX))
.add_system_to_stage(
stage::UI,
widget::image_node_system.system().before(system::FLEX),
)
.add_system_to_stage(stage::UI, flex_node_system.system().label(system::FLEX))
.add_system_to_stage(stage::UI, ui_z_system.system())
.add_system_to_stage(stage::UI, flex_node_system.system())
.add_system_to_stage(bevy_render::stage::DRAW, widget::draw_text_system.system());

let resources = app.resources();
Expand Down

0 comments on commit e23c8a8

Please sign in to comment.