Skip to content

Commit

Permalink
fix: grid card images max height
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuscechetto committed Oct 28, 2024
1 parent ab3ef9d commit 434fdfc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Hearthstone Deck Tracker/Controls/GridCardImages.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ public void SetTitle(string title)

private const int MaxColumns = 3;
public static int GridWidth { get; } = 600;
public static int GridHeight { get; } = 800;
public static int GridHeight { get; } = 750;

private const double MaxCardWidth = 256 * 0.75;
private const double MaxCardHeight = 388 * 0.75;
private const double MaxCardWidth = 256 * 0.7;
private const double MaxCardHeight = 388 * 0.7;

private int _maxGridHeight = GridHeight;
public Thickness CardMargin => CalculateCardMargin();

private Thickness CalculateCardMargin()
{
var scaleFactor = CardHeight / BaseCardHeight;
var topBottomMargin = -10 * scaleFactor;
var topBottomMargin = -13 * scaleFactor;
var leftRightMargin = -2 * scaleFactor;
return new Thickness(leftRightMargin, topBottomMargin, leftRightMargin, topBottomMargin);
}
Expand Down

0 comments on commit 434fdfc

Please sign in to comment.