Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Cufee committed Jan 19, 2025
2 parents 9f17d6c + 0895114 commit 8f7cf99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions internal/stats/render/period/v2/cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ func generateCards(stats fetch.AccountStatsOverPeriod, cards period.Cards, _ []m

cardsFrame := facepaint.NewBlocksContent(style.NewStyle(style.Parent(styledCardsFrame)), statsCards...)

// add background branding
if opts.Background != nil && !opts.BackgroundIsCustom {
// resize and place background
if opts.Background != nil {
cardsFrameSize := cardsFrame.Dimensions()
seed, _ := strconv.Atoi(stats.Account.ID)
opts.Background = imaging.Resize(opts.Background, cardsFrameSize.Width, cardsFrameSize.Height, imaging.Lanczos)
opts.Background = addBackgroundBranding(opts.Background, stats.RegularBattles.Vehicles, seed)
}
// add background
if opts.Background != nil {
if !opts.BackgroundIsCustom {
seed, _ := strconv.Atoi(stats.Account.ID)
opts.Background = addBackgroundBranding(opts.Background, stats.RegularBattles.Vehicles, seed)
}
cardsFrame = facepaint.NewBlocksContent(style.NewStyle(),
facepaint.MustNewImageContent(styledCardsBackground, opts.Background), cardsFrame,
)
Expand Down
4 changes: 2 additions & 2 deletions render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
_ "github.com/joho/godotenv/autoload"
)

var bgImage = "static://bg-default"
var bgIsCustom = false
var bgImage = "static://test_user_background"
var bgIsCustom = true

func init() {
loadStaticAssets(static)
Expand Down

0 comments on commit 8f7cf99

Please sign in to comment.