diff options
author | 2020-12-18 11:28:55 +0100 | |
---|---|---|
committer | 2020-12-18 11:35:01 +0100 | |
commit | 10d6df73e34e421cbf96d62b26c0c0701d9096ef (patch) | |
tree | ba45c33eb69ce31ec50bd73f99c28e65ee1c9215 /native | |
parent | c54a6446a3a22077af651cddb37eaeb5f659e316 (diff) | |
download | iced-10d6df73e34e421cbf96d62b26c0c0701d9096ef.tar.gz iced-10d6df73e34e421cbf96d62b26c0c0701d9096ef.tar.bz2 iced-10d6df73e34e421cbf96d62b26c0c0701d9096ef.zip |
Remove `max_width` and `max_height` from `image::Viewer`
The support for these layout constraints is currently not ideal. We
should reintroduce these methods once our layout engine improves.
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/image/viewer.rs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/native/src/widget/image/viewer.rs b/native/src/widget/image/viewer.rs index ba4ee087..4ec3faf6 100644 --- a/native/src/widget/image/viewer.rs +++ b/native/src/widget/image/viewer.rs @@ -8,7 +8,7 @@ use crate::{ Widget, }; -use std::{f32, hash::Hash, u32}; +use std::hash::Hash; /// A frame that displays an image with the ability to zoom in/out and pan. #[allow(missing_debug_implementations)] @@ -17,8 +17,6 @@ pub struct Viewer<'a> { padding: u16, width: Length, height: Length, - max_width: u32, - max_height: u32, min_scale: f32, max_scale: f32, scale_step: f32, @@ -35,8 +33,6 @@ impl<'a> Viewer<'a> { padding: 0, width: Length::Shrink, height: Length::Shrink, - max_width: u32::MAX, - max_height: u32::MAX, min_scale: 0.25, max_scale: 10.0, scale_step: 0.10, @@ -62,18 +58,6 @@ impl<'a> Viewer<'a> { self } - /// Sets the max width of the [`Viewer`]. - pub fn max_width(mut self, max_width: u32) -> Self { - self.max_width = max_width; - self - } - - /// Sets the max height of the [`Viewer`]. - pub fn max_height(mut self, max_height: u32) -> Self { - self.max_height = max_height; - self - } - /// Sets the max scale applied to the image of the [`Viewer`]. /// /// Default is `10.0` @@ -315,8 +299,6 @@ where self.width.hash(state); self.height.hash(state); - self.max_width.hash(state); - self.max_height.hash(state); self.padding.hash(state); self.handle.hash(state); |