Skip to content

Commit

Permalink
apply current transform matrix to Path2Ds used as clips
Browse files Browse the repository at this point in the history
- fixes #207
  • Loading branch information
samizdatco committed Dec 18, 2024
1 parent cb63e2c commit f125bcb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ impl Context2D{
}

pub fn clip_path(&mut self, path: Option<Path>, rule:FillType){
let mut clip = path.unwrap_or_else(|| self.path.clone()) ;
let mut clip = match path{
Some(path) => path.with_transform(&self.state.matrix),
None => self.path.clone()
};
clip.set_fill_type(rule);

self.state.clip = match &self.state.clip {
Expand Down

0 comments on commit f125bcb

Please sign in to comment.