Skip to content

Commit

Permalink
docs: use better names for the local variable to show what is it holding
Browse files Browse the repository at this point in the history
  • Loading branch information
MojtabaHs committed Sep 30, 2024
1 parent d47ee2e commit 398a7cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/SwiftUIFlowLayout/SwiftUIFlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ public struct FlowLayout<RefreshBinding, Data: Collection, ItemView: View>: View
height -= lastHeight
}
lastHeight = d.height
let result = width
let currentWidth = width
let extraWidth = -itemSpacing * CGFloat(row)
if index == itemCount - 1 {
width = 0
} else {
width -= d.width
}
return result + extraWidth
return currentWidth + extraWidth
})
.alignmentGuide(.top, computeValue: { d in
let result = height
let currentHeight = height
let extraHeight = -itemSpacing * CGFloat(column)
if index == itemCount - 1 {
height = 0
}
return result + extraHeight
return currentHeight + extraHeight
})
}
}
Expand Down

0 comments on commit 398a7cd

Please sign in to comment.