diff --git a/layouts/flow.go b/layouts/flow.go index f083673..2420d0f 100644 --- a/layouts/flow.go +++ b/layouts/flow.go @@ -45,13 +45,14 @@ func (flow Flow) Arrange (hints tomo.LayoutHints, boxes tomo.BoxArranger) { index := 0 for index < boxes.Len() { // get a slice of boxes for this major step - stepIndexEnd := index + minorSteps + stepIndexStart := index + stepIndexEnd := index + minorSteps if stepIndexEnd > boxes.Len() { stepIndexEnd = boxes.Len() } index += minorSteps // find a major size that will fit all boxes on this major step majorSize := 0 - for index := index; index < stepIndexEnd; index ++ { + for index := stepIndexStart; index < stepIndexEnd; index ++ { boxSize := flow.major(boxes.MinimumSize(index)) if boxSize > majorSize { majorSize = boxSize } } @@ -61,7 +62,7 @@ func (flow Flow) Arrange (hints tomo.LayoutHints, boxes tomo.BoxArranger) { var size image.Point size = flow.incrMajor(size, majorSize) size = flow.incrMinor(size, minorSize) - for index := index; index < stepIndexEnd; index ++ { + for index := stepIndexStart; index < stepIndexEnd; index ++ { bounds := image.Rectangle { Min: point, Max: point.Add(size) } boxes.SetBounds(index, bounds)