Auto merge of #421 - pcwalton:canvas-nested-clip-paths, r=pcwalton
Allow clip paths to nest in the canvas API. Closes #372.
This commit is contained in:
commit
e48b2759dd
|
@ -358,8 +358,11 @@ impl CanvasRenderingContext2D {
|
|||
|
||||
let mut clip_path = ClipPath::new(outline);
|
||||
clip_path.set_fill_rule(fill_rule);
|
||||
let clip_path_id = self.canvas.scene.push_clip_path(clip_path);
|
||||
if let Some(existing_clip_path) = self.current_state.clip_path.take() {
|
||||
clip_path.set_clip_path(Some(existing_clip_path));
|
||||
}
|
||||
|
||||
let clip_path_id = self.canvas.scene.push_clip_path(clip_path);
|
||||
self.current_state.clip_path = Some(clip_path_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue