Skip to content

Commit

Permalink
apply fix from bevyengine#5595 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Sep 7, 2022
1 parent d13d6c2 commit 3f1cc36
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/bevy_color_blindness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
//! color blindness.
use bevy_app::{App, Plugin};
use bevy_asset::{load_internal_asset, Assets, Handle, HandleUntyped};
use bevy_asset::{load_internal_asset, AssetEvent, Assets, Handle, HandleUntyped};
use bevy_core_pipeline::core_2d::Camera2dBundle;
use bevy_ecs::{
component::Component,
entity::Entity,
prelude::EventReader,
prelude::{EventReader, EventWriter},
query::{Added, Changed},
system::{Commands, Query, Res, ResMut},
};
Expand Down Expand Up @@ -461,12 +461,15 @@ fn setup_new_color_blindness_cameras(
},
..Camera2dBundle::default()
})
.insert(post_processing_pass_layer);
.insert(post_processing_pass_layer)
.id();
commands.entity(entity);
}
}

fn update_image_to_window_size(
windows: Res<Windows>,
mut image_events: EventWriter<AssetEvent<Image>>,
mut images: ResMut<Assets<Image>>,
mut resize_events: EventReader<WindowResized>,
fit_to_window_size: Query<&FitToWindowSize>,
Expand All @@ -486,6 +489,9 @@ fn update_image_to_window_size(
"FitToScreenSize is referring to an Image, but this Image could not be found",
);
image.resize(size);
image_events.send(AssetEvent::Modified {
handle: fit_to_window.image.clone(),
});
}
}
}
Expand Down

0 comments on commit 3f1cc36

Please sign in to comment.