Skip to content

Commit

Permalink
feat: Do not compute offset for leading alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Oct 24, 2024
1 parent ccfdb96 commit 33591ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/InfomaniakCoreSwiftUI/Layouts/FlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ public struct FlowLayout: Layout {
}

private func computeAlignmentOffsets(containerWidth: CGFloat, offsets: [[CGRect]]) -> [CGFloat] {
var alignmentOffsets = [CGFloat]()
guard alignment != .leading else {
return Array(repeating: 0, count: offsets.count)
}

var alignmentOffsets = [CGFloat]()
for line in offsets {
guard let lineWidth = line.last?.maxX else {
alignmentOffsets.append(0)
Expand Down

0 comments on commit 33591ec

Please sign in to comment.