Skip to content

Commit

Permalink
Change scaling factor for both dimensions to fit the icons size.
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Sep 10, 2022
1 parent 45c8714 commit 5a8b9d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs
Expand Up @@ -42,7 +42,8 @@ public static Geometry GetCursorGeometry(string pathData, TransformGroup transfo
transformGroup.Children.Add(new TranslateTransform(-rect.X, -rect.Y));

// Apply the requested size.
transformGroup.Children.Add(new ScaleTransform(width / rect.Width, height / rect.Height));
var aspectRatio = Math.Min(width / rect.Width, height / rect.Height);
transformGroup.Children.Add(new ScaleTransform(aspectRatio, aspectRatio));


geometry.Freeze();
Expand Down

0 comments on commit 5a8b9d0

Please sign in to comment.