public void layout () {
		if (sizeInvalid) {
			computeSize();
			if (lastPrefHeight != prefHeight) {
				lastPrefHeight = prefHeight;
				invalidateHierarchy();
			}
		}
		SnapshotArray<Actor> children = getChildren();
		float groupWidth = getWidth();
		float x = 0;
		float y = getHeight();
		float maxHeight = 0;
		for (int i = 0, n = children.size; i < n; i++) {
			Actor child = children.get(i);
			float width = child.getWidth();
			float height = child.getHeight();
			if (child instanceof Layout) {
				Layout layout = (Layout) child;
				width = layout.getPrefWidth();
				height = layout.getPrefHeight();
			}
			if (x + width <= groupWidth) {				
				maxHeight = Math.max(height, maxHeight);
			} else {
				y -= maxHeight + spacing;
				maxHeight = height;
				x = 0;
			}
			child.setBounds(x, y - height, width, height);
			x += width + spacing;
		}
	}