Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image::viewer::Viewer zoom in/out with mouse scrolling doesn't work #2713

Open
4 tasks done
rhysd opened this issue Jan 1, 2025 · 0 comments
Open
4 tasks done

image::viewer::Viewer zoom in/out with mouse scrolling doesn't work #2713

rhysd opened this issue Jan 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rhysd
Copy link

rhysd commented Jan 1, 2025

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

iced::widget::image::viewer::Viewer provides the functionality to zoom in/out by scrolling up/down. However it has stopped working from the latest of master branch.

Here is the reproduction:

use iced::widget::image::viewer::Viewer;
use iced::widget::image::Handle;
use iced::widget::{container, Container};
use iced::Length::Fill;
use std::env;

struct App(Handle);

impl Default for App {
    fn default() -> Self {
        Self(Handle::from_path(env::args_os().nth(1).unwrap()))
    }
}

impl App {
    fn update(&mut self, _: ()) {}

    fn view(&self) -> Container<()> {
        container(Viewer::new(&self.0).width(Fill).height(Fill)).center(Fill)
    }
}

fn main() -> iced::Result {
    iced::run("Test", App::update, App::view)
}

Run this program with passing an image file path to the first command line argument. Then try to zoom in/out the image in the window by scrolling up/down. Nothing happens. After that, resizing window reflects the zoom in/out.

This example works fine with iced v0.13.1 (9bfbd7c), however it doesn't work on the latest master branch (f2c9b6b).

What is the expected behavior?

Scrolling up/down on Viewer widget makes the image zoom in/out same as v0.13.1.

Version

master

Operating System

macOS

Do you have any log output?

No response

@rhysd rhysd added the bug Something isn't working label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant