Skip to content

Commit

Permalink
Fix drawing of cropped images
Browse files Browse the repository at this point in the history
Calls CoreGraphicsContext::draw_image() from CoreGraphicsContext::draw_image_area() after cropping the image.
  • Loading branch information
longmathemagician committed Jul 28, 2022
1 parent 67ef625 commit 086e8e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions piet-coregraphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ impl<'a> RenderContext for CoreGraphicsContext<'a> {
) {
if let CoreGraphicsImage::NonEmpty(image) = image {
if let Some(cropped) = image.cropped(to_cgrect(src_rect)) {
// TODO: apply interpolation mode
self.ctx.draw_image(to_cgrect(dst_rect), &cropped);
self.draw_image(&CoreGraphicsImage::NonEmpty(cropped), dst_rect, _interp);
}
}
}
Expand Down

0 comments on commit 086e8e6

Please sign in to comment.