File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ public struct WrapLayout: Layout {
7272
7373 let calculatedSize = view. sizeThatFits ( . init( width: bounds. width, height: bounds. height) )
7474
75- if ( calculatedSize. width + offsetX) >= bounds. width {
75+ if ( calculatedSize. width + offsetX + horizontalSpacing ) >= bounds. width {
7676 // line break
7777 currentLine. width = offsetX
7878
@@ -88,14 +88,15 @@ public struct WrapLayout: Layout {
8888
8989 currentLine. elements. append ( calculatedElement)
9090
91- offsetX += calculatedSize. width + horizontalSpacing
91+ offsetX += calculatedSize. width
9292
9393 if currentLine. height < calculatedElement. size. height {
9494 currentLine. height = calculatedElement. size. height
9595 }
9696
9797 }
9898
99+ currentLine. width = offsetX
99100 cache. lines. append ( currentLine)
100101
101102 let size = cache. calculateSize ( verticalSpacing: verticalSpacing)
You can’t perform that action at this time.
0 commit comments