File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,12 +79,11 @@ private struct HeatmapLayout {
7979 let monthTitleSpacing : CGFloat = 6
8080
8181 init ( availableWidth: CGFloat , weekCounts: [ Int ] ) {
82- let sanitizedWeekCounts = weekCounts. filter { 0 < $0 }
83- let totalColumns = max ( sanitizedWeekCounts. reduce ( 0 , + ) , 1 )
84- let totalColumnSpacings = sanitizedWeekCounts. reduce ( 0 ) { partialResult, count in
82+ let totalColumns = max ( weekCounts. reduce ( 0 , + ) , 1 )
83+ let totalColumnSpacings = weekCounts. reduce ( 0 ) { partialResult, count in
8584 partialResult + max( count - 1 , 0 )
8685 }
87- let fixedWidth = monthSpacing * CGFloat( max ( sanitizedWeekCounts . count - 1 , 0 ) )
86+ let fixedWidth = monthSpacing * CGFloat( max ( weekCounts . count - 1 , 0 ) )
8887 + cellSpacing * CGFloat( totalColumnSpacings)
8988 cellSize = max ( 0 , availableWidth - fixedWidth) / CGFloat( totalColumns)
9089 }
You can’t perform that action at this time.
0 commit comments