summaryrefslogtreecommitdiffstats
path: root/renderer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:52:55 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:52:55 +0200
commitd4b08462e5a25929ec4df32f242898986902af56 (patch)
tree4c6aaf8519b416ebf075fd780e533543416cc81e /renderer
parent8708101c892540ffc966cf7ee9d66ca5cd2e8ca6 (diff)
downloadiced-d4b08462e5a25929ec4df32f242898986902af56.tar.gz
iced-d4b08462e5a25929ec4df32f242898986902af56.tar.bz2
iced-d4b08462e5a25929ec4df32f242898986902af56.zip
Introduce `Svg` struct in `core::svg`
Diffstat (limited to 'renderer')
-rw-r--r--renderer/src/fallback.rs36
1 files changed, 6 insertions, 30 deletions
diff --git a/renderer/src/fallback.rs b/renderer/src/fallback.rs
index dc8a4107..fbd285db 100644
--- a/renderer/src/fallback.rs
+++ b/renderer/src/fallback.rs
@@ -3,8 +3,7 @@ use crate::core::image;
use crate::core::renderer;
use crate::core::svg;
use crate::core::{
- self, Background, Color, Image, Point, Radians, Rectangle, Size,
- Transformation,
+ self, Background, Color, Image, Point, Rectangle, Size, Svg, Transformation,
};
use crate::graphics;
use crate::graphics::compositor;
@@ -164,19 +163,8 @@ where
delegate!(self, renderer, renderer.measure_svg(handle))
}
- fn draw_svg(
- &mut self,
- handle: svg::Handle,
- color: Option<Color>,
- bounds: Rectangle,
- rotation: Radians,
- opacity: f32,
- ) {
- delegate!(
- self,
- renderer,
- renderer.draw_svg(handle, color, bounds, rotation, opacity)
- );
+ fn draw_svg(&mut self, svg: Svg, bounds: Rectangle) {
+ delegate!(self, renderer, renderer.draw_svg(svg, bounds));
}
}
@@ -425,8 +413,7 @@ where
#[cfg(feature = "geometry")]
mod geometry {
use super::Renderer;
- use crate::core::svg;
- use crate::core::{Color, Point, Radians, Rectangle, Size, Vector};
+ use crate::core::{Point, Radians, Rectangle, Size, Svg, Vector};
use crate::graphics::cache::{self, Cached};
use crate::graphics::geometry::{self, Fill, Image, Path, Stroke, Text};
@@ -561,19 +548,8 @@ mod geometry {
delegate!(self, frame, frame.draw_image(bounds, image));
}
- fn draw_svg(
- &mut self,
- handle: &svg::Handle,
- bounds: Rectangle,
- color: Option<Color>,
- rotation: Radians,
- opacity: f32,
- ) {
- delegate!(
- self,
- frame,
- frame.draw_svg(handle, bounds, color, rotation, opacity)
- );
+ fn draw_svg(&mut self, bounds: Rectangle, svg: impl Into<Svg>) {
+ delegate!(self, frame, frame.draw_svg(bounds, svg));
}
fn push_transform(&mut self) {