From 43f7e9314f83e95537e78f1325366a55609c4d8f Mon Sep 17 00:00:00 2001 From: Christoph Grabo Date: Sun, 26 Jun 2022 19:53:05 +0200 Subject: [PATCH] Allow minimising This change is copied verbatim from bevy itself. See: https://github.com/bevyengine/bevy/commit/09a3d8abe062984479bf0e99fcc1508bb722baf6 --- bevy_kayak_renderer/src/render/ui_pass.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bevy_kayak_renderer/src/render/ui_pass.rs b/bevy_kayak_renderer/src/render/ui_pass.rs index e3a5ea1d..7b258a69 100644 --- a/bevy_kayak_renderer/src/render/ui_pass.rs +++ b/bevy_kayak_renderer/src/render/ui_pass.rs @@ -62,10 +62,12 @@ impl Node for MainPassUINode { world: &World, ) -> Result<(), NodeRunError> { let view_entity = graph.get_input_entity(Self::IN_VIEW)?; - let (transparent_phase, target) = self - .query - .get_manual(world, view_entity) - .expect("view entity should exist"); + // adapted from bevy itself; + // see: + let (transparent_phase, target) = match self.query.get_manual(world, view_entity) { + Ok(it) => it, + _ => return Ok(()), + }; // let clear_color = world.get_resource::().unwrap(); { let pass_descriptor = RenderPassDescriptor {