From e6f23e37719ccc52e3a3802e204a9b33aeba9d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 18 Dec 2020 10:53:38 +0100 Subject: [PATCH] Rename `scale_pct` to `scale_step` in `image::Viewer` --- native/src/widget/image/viewer.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/native/src/widget/image/viewer.rs b/native/src/widget/image/viewer.rs index 3402cf18..c8656101 100644 --- a/native/src/widget/image/viewer.rs +++ b/native/src/widget/image/viewer.rs @@ -21,7 +21,7 @@ pub struct Viewer<'a> { max_height: u32, min_scale: f32, max_scale: f32, - scale_pct: f32, + scale_step: f32, handle: image::Handle, } @@ -41,7 +41,7 @@ impl<'a> Viewer<'a> { max_height: u32::MAX, min_scale: 0.25, max_scale: 10.0, - scale_pct: 0.10, + scale_step: 0.10, handle, } } @@ -112,8 +112,8 @@ impl<'a> Viewer<'a> { /// Default is `0.10` /// /// [`Viewer`]: struct.Viewer.html - pub fn scale_pct(mut self, scale_pct: f32) -> Self { - self.scale_pct = scale_pct; + pub fn scale_step(mut self, scale_step: f32) -> Self { + self.scale_step = scale_step; self } @@ -230,10 +230,10 @@ where self.state.scale = Some( (if y > 0.0 { self.state.scale.unwrap_or(1.0) - * (1.0 + self.scale_pct) + * (1.0 + self.scale_step) } else { self.state.scale.unwrap_or(1.0) - / (1.0 + self.scale_pct) + / (1.0 + self.scale_step) }) .max(self.min_scale) .min(self.max_scale),