 			right += rightMargin
 
 		# get x
-		if right > maxFlowWidth and y > 0
+		if right > maxFlowWidth and visibleChildrenIndex > 0
 			right -= x
 			x = right - width
 			currentRowY += rowsHeight[currentRow]

		# increase x and y by the size
		x += width
		y += height

	# flow size
	if includeBorderMargins

	x = y = right = bottom = 0

	# calculate children positions
	rowsFillsSum = visibleChildrenIndex = 0
	for child, i in children
		# omit not visible
		if not child._visible
