summaryrefslogtreecommitdiffstats
path: root/widget/src/svg.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 12:02:42 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 12:02:42 +0100
commit534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0 (patch)
tree0ddc8f1b681cbade7e47293bd46a362896aa538a /widget/src/svg.rs
parent17135cbd56316f31167eb62e026839450506573f (diff)
parentc4ba657de86d7606587dad5124f435141258f570 (diff)
downloadiced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.tar.gz
iced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.tar.bz2
iced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.zip
Merge branch 'master' into update-winit
Diffstat (limited to 'widget/src/svg.rs')
-rw-r--r--widget/src/svg.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/widget/src/svg.rs b/widget/src/svg.rs
index 2d01d1ab..830abb0f 100644
--- a/widget/src/svg.rs
+++ b/widget/src/svg.rs
@@ -96,12 +96,11 @@ where
Renderer: svg::Renderer,
Renderer::Theme: iced_style::svg::StyleSheet,
{
- fn width(&self) -> Length {
- self.width
- }
-
- fn height(&self) -> Length {
- self.height
+ fn size(&self) -> Size<Length> {
+ Size {
+ width: self.width,
+ height: self.height,
+ }
}
fn layout(
@@ -115,10 +114,7 @@ where
let image_size = Size::new(width as f32, height as f32);
// The size to be available to the widget prior to `Shrink`ing
- let raw_size = limits
- .width(self.width)
- .height(self.height)
- .resolve(image_size);
+ let raw_size = limits.resolve(self.width, self.height, image_size);
// The uncropped size of the image when fit to the bounds above
let full_size = self.content_fit.fit(image_size, raw_size);