| 220 | } |
| 221 | |
| 222 | pub fn push_layer(&mut self, clip: &impl Shape) { |
| 223 | { |
| 224 | // Clone most recent local transform onto the stack |
| 225 | let local_transform = self.local_transform_stack.last().copied().unwrap(); |
| 226 | self.local_transform_stack.push(local_transform); |
| 227 | } |
| 228 | |
| 229 | let transform = self.current_transform(); |
| 230 | self.scene |
| 231 | .push_clip_layer(StyleRef::Fill(Fill::EvenOdd), transform, clip); |
| 232 | self.clip_stack.push(transform * clip.to_path(0.1)); |
| 233 | } |
| 234 | |
| 235 | pub fn pop_layer(&mut self) { |
| 236 | self.local_transform_stack.pop(); |