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.
This commit is contained in:
parent
c54a6446a3
commit
10d6df73e3
@ -8,7 +8,7 @@ use crate::{
|
|||||||
Widget,
|
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.
|
/// A frame that displays an image with the ability to zoom in/out and pan.
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
@ -17,8 +17,6 @@ pub struct Viewer<'a> {
|
|||||||
padding: u16,
|
padding: u16,
|
||||||
width: Length,
|
width: Length,
|
||||||
height: Length,
|
height: Length,
|
||||||
max_width: u32,
|
|
||||||
max_height: u32,
|
|
||||||
min_scale: f32,
|
min_scale: f32,
|
||||||
max_scale: f32,
|
max_scale: f32,
|
||||||
scale_step: f32,
|
scale_step: f32,
|
||||||
@ -35,8 +33,6 @@ impl<'a> Viewer<'a> {
|
|||||||
padding: 0,
|
padding: 0,
|
||||||
width: Length::Shrink,
|
width: Length::Shrink,
|
||||||
height: Length::Shrink,
|
height: Length::Shrink,
|
||||||
max_width: u32::MAX,
|
|
||||||
max_height: u32::MAX,
|
|
||||||
min_scale: 0.25,
|
min_scale: 0.25,
|
||||||
max_scale: 10.0,
|
max_scale: 10.0,
|
||||||
scale_step: 0.10,
|
scale_step: 0.10,
|
||||||
@ -62,18 +58,6 @@ impl<'a> Viewer<'a> {
|
|||||||
self
|
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`].
|
/// Sets the max scale applied to the image of the [`Viewer`].
|
||||||
///
|
///
|
||||||
/// Default is `10.0`
|
/// Default is `10.0`
|
||||||
@ -315,8 +299,6 @@ where
|
|||||||
|
|
||||||
self.width.hash(state);
|
self.width.hash(state);
|
||||||
self.height.hash(state);
|
self.height.hash(state);
|
||||||
self.max_width.hash(state);
|
|
||||||
self.max_height.hash(state);
|
|
||||||
self.padding.hash(state);
|
self.padding.hash(state);
|
||||||
|
|
||||||
self.handle.hash(state);
|
self.handle.hash(state);
|
||||||
|
Loading…
Reference in New Issue
Block a user