Skip to content

Commit 6dab4e5

Browse files
committed
Persist style state across frames.
1 parent 3ea1816 commit 6dab4e5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

crates/processing_render/src/graphics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ pub fn begin_draw(In(entity): In<Entity>, mut state_query: Query<&mut RenderStat
396396
let mut state = state_query
397397
.get_mut(entity)
398398
.map_err(|_| ProcessingError::GraphicsNotFound)?;
399-
state.reset();
399+
state.begin_frame();
400400
Ok(())
401401
}
402402

crates/processing_render/src/render/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ impl RenderState {
122122
self.shape_builder = None;
123123
}
124124

125+
pub fn begin_frame(&mut self) {
126+
self.transform = TransformStack::new();
127+
self.shape_builder = None;
128+
}
129+
125130
pub fn fill_is_transparent(&self) -> bool {
126131
self.fill_color.map(|c| c.alpha() < 1.0).unwrap_or(false)
127132
}

0 commit comments

Comments
 (0)