Skip to content

Commit

Permalink
fixed: Toolbar Zoom In and Out Ignores Custom Zoom Levels #1778
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Dec 15, 2023
1 parent f3a32ee commit 3a23650
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion Source/ImageGlass/FrmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,6 @@ private void HandleImageProgress_Loading(ImageLoadingEventArgs e)
}


[SuppressMessage("IDisposableAnalyzers.Correctness", "IDISP007:Don't dispose injected", Justification = "<Pending>")]
private async Task HandleImageProgress_LoadedAsync(ImageLoadedEventArgs e)
{
var error = e.Error;
Expand Down
15 changes: 15 additions & 0 deletions Source/ImageGlass/FrmMain/FrmMain.IGMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,13 @@ public void IG_ZoomIn()

public async Task ZoomInAsync()
{
if (PicMain.ZoomLevels.Length > 0)
{
PicMain.ZoomIn();
return;
}

// smooth zooming
PicMain.StartAnimation(AnimationSource.ZoomIn);
await Task.Delay(100);

Expand All @@ -481,6 +488,13 @@ public void IG_ZoomOut()

public async Task ZoomOutAsync()
{
if (PicMain.ZoomLevels.Length > 0)
{
PicMain.ZoomOut();
return;
}

// smooth zooming
PicMain.StartAnimation(AnimationSource.ZoomOut);
await Task.Delay(100);

Expand Down Expand Up @@ -1175,6 +1189,7 @@ public async Task CopyImageDataAsync()
/// <summary>
/// Pastes image from clipboard and opens it.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness", "IDISP001:Dispose created", Justification = "<Pending>")]
public void IG_PasteImage()
{
// Is there a file in clipboard?
Expand Down

0 comments on commit 3a23650

Please sign in to comment.