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

Fix autozoom mode #54

Open
dy opened this issue Mar 6, 2021 · 2 comments
Open

Fix autozoom mode #54

dy opened this issue Mar 6, 2021 · 2 comments
Assignees
Labels
3.2.x 🦌 enhancement Improve existing feature

Comments

@dy
Copy link

dy commented Mar 6, 2021

Now autozoom resets every time next/prev image is clicked:
image
image
Which makes jagged slideshow experience in fullscreen. Is there a way to force zoom level for all images?

@Beelink Beelink self-assigned this Mar 6, 2021
@Beelink Beelink added the 🦌 enhancement Improve existing feature label Mar 6, 2021
@Beelink Beelink added the 3.2.x label Mar 24, 2021
@Znunu
Copy link

Znunu commented Jan 26, 2022

this never gonna be fixed?

@Haukinger
Copy link

I might be missing something, but passing auto instead of 100% in the first else in CheckAutoZoomNeeded makes it auto-zoom new images by default:

	private void CheckAutoZoomNeeded()
	{
		if (originalImage != null)
		{
			if (!fullscreen && (originalImage.Width < picturePanel.Width - 32) && (originalImage.Height < picturePanel.Height - 32))
			{
				if (zoomTextBox.Text == "100%") setZoomFactor(100);
				else setZoomText(LangMan.Get("auto")); // was setZoomFactor(100);
			}
			else
			{
				setZoomText(LangMan.Get("auto"));
			}
		}
		else
		{
			setZoomText(LangMan.Get("auto"));
		}
	}

Seems like a typo to me, because the if doesn't really make sense, if you set 100% in the else, too.

I'd also simplify the method to something like this:

    private void CheckAutoZoomNeeded()
    {
        if (originalImage != null && !fullscreen && originalImage.Width < picturePanel.Width - 32 && originalImage.Height < picturePanel.Height - 32 && zoomTextBox.Text == "100%")
            setZoomFactor( 100 );
        else
            setZoomText( LangMan.Get( "auto" ) );
    }

No need for three else with the same body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.x 🦌 enhancement Improve existing feature
Projects
None yet
Development

No branches or pull requests

4 participants