Move core::Image::clip_bounds to graphics::Image

This commit is contained in:
Héctor Ramón Jiménez 2025-10-28 19:44:46 +01:00
parent 3cc5bd5dbc
commit 7c11ccb046
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
16 changed files with 189 additions and 88 deletions

View file

@ -777,9 +777,14 @@ impl core::image::Renderer for Renderer {
self.image_cache.borrow_mut().measure_image(handle)
}
fn draw_image(&mut self, image: core::Image, bounds: Rectangle) {
fn draw_image(
&mut self,
image: core::Image,
bounds: Rectangle,
clip_bounds: Rectangle,
) {
let (layer, transformation) = self.layers.current_mut();
layer.draw_raster(image, bounds, transformation);
layer.draw_raster(image, bounds, clip_bounds, transformation);
}
}
@ -789,9 +794,14 @@ impl core::svg::Renderer for Renderer {
self.image_cache.borrow_mut().measure_svg(handle)
}
fn draw_svg(&mut self, svg: core::Svg, bounds: Rectangle) {
fn draw_svg(
&mut self,
svg: core::Svg,
bounds: Rectangle,
clip_bounds: Rectangle,
) {
let (layer, transformation) = self.layers.current_mut();
layer.draw_svg(svg, bounds, transformation);
layer.draw_svg(svg, bounds, clip_bounds, transformation);
}
}