diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
commit | 3b21e4c9d1d72a2ba71e4e4c1a2f60fb51f67205 (patch) | |
tree | cb83a9aae70b397c8e5504f889d71787e7f99f18 /stockton-skeleton/src/draw_passes/cons.rs | |
parent | 9b4edc67d315a640a9d22f84919b0dd81e201f1d (diff) |
fix(render): handle_surface_change
Diffstat (limited to 'stockton-skeleton/src/draw_passes/cons.rs')
-rw-r--r-- | stockton-skeleton/src/draw_passes/cons.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/stockton-skeleton/src/draw_passes/cons.rs b/stockton-skeleton/src/draw_passes/cons.rs index 51c06a6..dea42af 100644 --- a/stockton-skeleton/src/draw_passes/cons.rs +++ b/stockton-skeleton/src/draw_passes/cons.rs @@ -32,12 +32,26 @@ macro_rules! cons_shared_impl { } fn handle_surface_change( - &mut self, + mut self, session: &Session, context: &mut RenderingContext, - ) -> Result<()> { - self.a.handle_surface_change(session, context)?; - self.b.handle_surface_change(session, context) + ) -> Result<Self> { + match self.a.handle_surface_change(session, context) { + Ok(a) => self.a = a, + Err(e) => { + self.b.deactivate(context)?; + return Err(e); + } + } + match self.b.handle_surface_change(session, context) { + Ok(b) => self.b = b, + Err(e) => { + self.a.deactivate(context)?; + return Err(e); + } + } + + Ok(self) } }; } |