Skip to content

Commit

Permalink
Remove max_width and max_height from image::Viewer
Browse files Browse the repository at this point in the history
The support for these layout constraints is currently not ideal. We
should reintroduce these methods once our layout engine improves.
  • Loading branch information
hecrj committed Dec 18, 2020
1 parent c54a644 commit 10d6df7
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions native/src/widget/image/viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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`
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 10d6df7

Please sign in to comment.