Skip to content

Commit

Permalink
fix: lines count
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed May 28, 2024
1 parent bfbff91 commit e13d0ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ func GenerateGraph(contributors []ContributorInfoDownload) string {
// Generate SVG with template

avatarSpace := AvatarSize + 2*AvatarMargin
linesCount := len(contributors) / AvatarsPerLine
if len(contributors)%AvatarsPerLine > 0 {
linesCount++
}

startTemplate := fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="%d" height="%d">`, AvatarsPerLine*avatarSpace, (len(contributors)/AvatarsPerLine+1)*avatarSpace)
startTemplate := fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="%d" height="%d">`, AvatarsPerLine*avatarSpace, linesCount*avatarSpace)
styleTemplate := `<style></style>`

internalContent := ""
Expand Down

0 comments on commit e13d0ba

Please sign in to comment.