quick-picture-viewer
quick-picture-viewer copied to clipboard
Fix autozoom mode
Now autozoom resets every time next/prev image is clicked:
Which makes jagged slideshow experience in fullscreen. Is there a way to force zoom level for all images?
this never gonna be fixed?
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.