diff options
| author | 2023-11-11 07:02:01 +0100 | |
|---|---|---|
| committer | 2023-11-11 07:22:51 +0100 | |
| commit | a5125d6fea824df1191777fe3eb53a2f748208b9 (patch) | |
| tree | 4c854e4367af13bf02ae0e052a28a95f79437f3a /widget/src/image | |
| parent | 75c9afc608a4a9ff44d60a8fb6f4a5819f05bf79 (diff) | |
| download | iced-a5125d6fea824df1191777fe3eb53a2f748208b9.tar.gz iced-a5125d6fea824df1191777fe3eb53a2f748208b9.tar.bz2 iced-a5125d6fea824df1191777fe3eb53a2f748208b9.zip | |
Refactor texture image filtering
- Support only `Linear` or `Nearest`
- Simplify `Layer` groups
- Move `FilterMethod` to `Image` and `image::Viewer`
Diffstat (limited to 'widget/src/image')
| -rw-r--r-- | widget/src/image/viewer.rs | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/widget/src/image/viewer.rs b/widget/src/image/viewer.rs index 44624fc8..68015ba8 100644 --- a/widget/src/image/viewer.rs +++ b/widget/src/image/viewer.rs @@ -22,19 +22,21 @@ pub struct Viewer<Handle> {      max_scale: f32,      scale_step: f32,      handle: Handle, +    filter_method: image::FilterMethod,  }  impl<Handle> Viewer<Handle> {      /// Creates a new [`Viewer`] with the given [`State`].      pub fn new(handle: Handle) -> Self {          Viewer { +            handle,              padding: 0.0,              width: Length::Shrink,              height: Length::Shrink,              min_scale: 0.25,              max_scale: 10.0,              scale_step: 0.10, -            handle, +            filter_method: image::FilterMethod::default(),          }      } @@ -329,6 +331,7 @@ where                  image::Renderer::draw(                      renderer,                      self.handle.clone(), +                    self.filter_method,                      Rectangle {                          x: bounds.x,                          y: bounds.y, | 
