diff options
Diffstat (limited to 'tiny_skia/src/layer.rs')
-rw-r--r-- | tiny_skia/src/layer.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tiny_skia/src/layer.rs b/tiny_skia/src/layer.rs index 48fca1d8..9a169f46 100644 --- a/tiny_skia/src/layer.rs +++ b/tiny_skia/src/layer.rs @@ -117,6 +117,48 @@ impl Layer { pub fn draw_image( &mut self, + image: &Image, + transformation: Transformation, + ) { + match image { + Image::Raster { + handle, + filter_method, + bounds, + rotation, + opacity, + snap: _, + } => { + self.draw_raster( + handle.clone(), + *filter_method, + *bounds, + transformation, + *rotation, + *opacity, + ); + } + Image::Vector { + handle, + color, + bounds, + rotation, + opacity, + } => { + self.draw_svg( + handle.clone(), + *color, + *bounds, + transformation, + *rotation, + *opacity, + ); + } + } + } + + pub fn draw_raster( + &mut self, handle: image::Handle, filter_method: image::FilterMethod, bounds: Rectangle, @@ -130,6 +172,7 @@ impl Layer { bounds: bounds * transformation, rotation, opacity, + snap: false, }; self.images.push(image); |